The JomSocial template contains very much and different template files.
Elements are includes on various locations.
But how can I find wich template element is loaded where.
Like Magento, there is a function that you can see each include inline (template path hints) like this:
dragonfroot.com/cms/wp-content/uploads/2...734_EnableTempl2.png
How can I find the template element location of each part?
HI.
In most cases file names are self explanatory :)
But if I'm not sure which element is in which file then I use Firebug or Chrome developer tool to locate certain object class name. Then I user search tool that can search text inside files and search for this certain class name. As a result I have list of files that contain that name. Then file name help me to find exact file. I use this method all the time. Just need to search for unique element name...
Searching on class based names is what I do now, but totally inaffective and you get a lot of wrong files.
I would think there is a sollution for finding the right include, it would be so easy to make that option (just put a div around an include). Otherwise finding files is a horrible job.
Hi.
I don't want to be snarky but I use this method all the time and it's 98% effective for me.
Many of objects/divs have unique classes. Just examine code structure and you'll know what class to search.
I'm afraid that there isn't other way to do it as in html code you cant see any php includes.
HI.
Includes are made by views main files stored here: ROOT/components/com_community/views
So for example file that is responsible for displaying group pages:
ROOT/components/com_community/views/groups/view.html.php in line 541:
->fetch('groups.index');
$discussionsHTML
$discussionsHTML = $tmpl->set('discussions', $discussions)
->set('groupId', $group->id)
->fetch('groups.discussionlist');
O jave added to the template.php on row 204
if ($_GET) return "<div style=\"border:1px solid red;position:relative;\" onmouseover=\"jQuery(this).css('z-index','9999');\" onmouseout=\"jQuery(this).css('z-index','');\"><div style=\"position:absolute;background:red;color:white;left:0;top:0;z-index:999999\" onclick=\"jQuery(this).remove();\">" . $file . "</div>" . $contents . "</div>";
This is a huge improvement in finding template files.
However, not all are included with the fetch function. How are the sidebar elements included?
Hi.
Sidebar elements are loaded in template file or use built-in module positions:
documentation.jomsocial.com/wiki/Built-in_Module_Positions
.
For example in ROOT/components/com_community/templates/default/profile.index.php:
$this->renderModules( 'js_side_top' ); - built-in module position
and
echo $this->view('profile')->modProfileUserVideo(); - that snippet loads this file: profile.video.php