I don't understand the code

Hi guys.

Here is the code snippet for mod/members/views/default/members/sidebar.php:

$body = elgg_view_form('members/tag_search', $params);

but I can't find the specified form in this path: mod/members/views/default/forms/members/tag_search.php

But it works properly. That's strange!!!

  • Not sure where it is offhand, but if you're sure it's not at that path it's entirely possible that the view is being provided by core.   Plugins can call views from anywhere.

    The way to check for sure is to use the developers plugin and inspect the view, it will tell you where it's loading any given view from.

  • Which version of Elgg are you using? In latest 1.9 and 1.10 the line in mod/members/views/default/members/sidebar.php is

    body = elgg_view_form('members/search', $params);

    and the members/search view is available. On Elgg 1.9 and 1.10 you can't search members by tags anymore but only by name.

    On Elgg 1.8 this was slightly different and tag_search / name_search forms were indeed called in mod/members/views/default/members/sidebar.php. The corresponding form views are not to be found in the members plugin folder but in Elgg's core view folder in views/default/forms/members.

  • I'm using elgg 1.8

    Thanks for complete answer @iionly

  • To figure out where views are coming from, you can always use the view inspector

    Enable the developers plugin at /admin/plugins#developers 

    Then inspect all registered views at /admin/develop_tools/inspect?inspect_type=Views

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