Hello all,
My problem is that I have create an object view in: ../mod/myplugin/views/default/object/myplugin.php and inside this file I have the following snipet:
echo elgg_view_title($vars['entity']->title);
echo elgg_view('output/tags', array('tags' => $vars['entity']->somefield));
echo elgg_view('output/tags', array('tags' => $vars['entity']->tags));
The problem is that this code never been executed. What I'm missing to make my own object view for my plugin.
Thx,
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.
- ihayredinov@ihayredinov
ihayredinov - 0 likes
You must log in to post replies.Views in views/default/object/ are automagic and correspond to entity subtype.
Consider this code:
$myentity = new ElggObject();
$myentity->subtype = 'my_entity_subtype';
...
$myentity->save();
echo elgg_view_entity($myentity);
The last bit will look for /views/default/object/my_entity_subtype.php and will fall back to /views/default/object/default.php if the view does not exist.