Hi. I've been looking at Example 2 in the advanced documentation regarding modifying the menu for ElggBlog objects http://learn.elgg.org/en/2.3/guides/menus.html In my case, I'm iterating through a list of individual blog entities and would like to only change the color of the thumbsup icon. I have a single blog entity already extracted using:
$blog = elgg_extract('entity', $vars, FALSE);
How can I now access the menu icons and change the style color for the thumbsup icon?
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
You can use setLinkClass() or setItemClass() for your item.
Also, there're addLinkClass() and addItemClass() which saves the existing classes but adds your own.
Of course, you should add specific classes and styles in your custom CSS.
ok... thanks. I guess I'm also stuck on how to pull the menuItems from the $blog entity.
All in an example provided by you ;)
The documentation example....?
Hmm.. ok going back to look at the example.. but that was a hook in the init.
is there not a way to just extract it from the blog entity instead of using the plugin hook?
Nope.
Crap.. that makes what I'm trying to do harder to figure out. The changing of the icon color is dependent on values in the response of a rest call out to an external service and that data isn't readily available for me to do the setItemClass call in the plugin hook. I override the blog object to hit the rest service for each blog post, then check to response to determine how to set the color for my menu items, but sounds like there's no easy way to do this from within blog.php.
In this case, why don't you want to use only CSS?
well.. I want to use whatever mechanism that allows me to change the color of the icon based on the response for that particular blog entity. Each blog post will trigger a rest call to get a response and then I need to change the color according to the response. I've seen examples on how to change css with straight php, but with elgg it looks a lot trickier.
- Previous
- 1
- 2
- Next
You must log in to post replies.