i have most likely asked this before. i still don't have a way to do this.
e.g. if i create a view that can be used on multiple pages and is called from it's own start.php file (such as one that adds a module the sidebar on any available page) - i do not immediately have a way of accessing the guid of any entity that may be being displayed on that page. this is limiting the posibilities of what i can code.
my current options are to add the module from within every plugin (blog/bookmarks) etc. to ensire the entity is passed through to the view (which would massively increase the amount of code i write) or i could scan the browser url for the guid (which would work but is not ideal since i prefer to keep these processes internal to the server).
or is there a way of accessing the current item's guid from an internal variable or function that i am not aware of?
anyone?
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 - 0 likes
- ura soul@tunist
ura soul - 0 likes
- ura soul@tunist
ura soul - 0 likes
- Matt Beckett@Beck24
Matt Beckett - 0 likes
- ura soul@tunist
ura soul - 0 likes
- ura soul@tunist
ura soul - 0 likes
You must log in to post replies.Only if the entity information is passed to the view
Typically as $vars['entity']
soo.. maybe, instead of adding a sidebar module directly from my plugin - i can insert a view into an existing view that does have the $vars['entity'] available, such as 'object/elements/full' and then call the sidebar module from there - passing in the entity variable.
woah, this is clunky!
i cannot do that with elgg_extend_view since it does not accept variables...
your view extension gets all of the variables that are passed to the view you are extending
yes, but if i am extending the sidebar with a module and the sidebar does not receive the variables (which it is not, as far as i am aware) - then the data is not available to the new module.
for now i will grab the guid from the address bar