im doing a tutorial in the elgg 1.8 handbook to create my first plugin.
it says try experimenting by passing user to the icon function and it should output the html for the image. <!--?php <br-->
/**
* English language file
*/
$mapping = array(
'hello:world' => "world",
'hello:dolly' => "Dolly",
'hello:menu' => "Hello",
'hello:sidebar:world' => "Hello world",
'hello:sidebar:dolly' => "Hello dolly",
'hello:user' => elgg_view_entity_icon()
//"Hello, %s!"
);
add_translation('en', $mapping);
?>
but it doesnt output html to me, only a blank area. why? what did i do wrong?
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.
- Matt Beckett@Beck24
Matt Beckett - 1 like
- Ramesh Janagama@RameshJanagama
Ramesh Janagama - 0 likes
You must log in to post replies.you didn't pass the user entity into the function, eg.
$user = elgg_get_logged_in_user_entity();
elgg_view_entity_icon($user, 'small');
I never thought of doing something like that in language files though... interesting.
too late but it may help few guys:
$content="Hello ";
$content.=elgg_view_entity_icon($user,'smail');
$content.=$user->name."!";