Dynamically update color of a blog menu icon

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?

  • I don’t know what you're trying to do but all possible using plugin' hook... and it’s not difficult, really.

  • So, until I get more familiar through experience, it's still a learning process for me.  Right now I'm overriding /mod/myplugin/views/object/blog.php to go make a rest call for each blog post that gets rendered.  I'm checking for a true or false value in the response.  If the response is true, change the icon color for that post to green, if the response is false, change the icon color for that post to red. 

    Are you saying that the logic that I have in my overridden blog.php object should be in a plugin hook?

  • Look at this:

    'metadata' => $metadata,

    in mod\blog\views\default\object\blog.php

    This is an entity menu that you can override using hook.

    Try to return on your first post. It was correct way.

  • Thanks for your assistance.  I was able to get it working.

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking