Notice

The forum is in read only mode.

Support Forum

Welcome! Support Forums have been reactivated
Welcome the Technical Support section. Help us in assisting you by providing us with a concise and descriptive elaboration of your issues. Be specific and if possible, provide us with a step-by-step instruction in replicating your problem.

Templating and paths

9 years 8 months ago
  • jw's Avatar
    Topic Author
  • jw
  • Offline
  • Fresh Boarder
  • Posts: 34
  • Thank you received: 6
Licenses:
JomSocial Active

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?

9 years 8 months ago
Licenses:

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...


- Instead of saying: 'it's not working', explain the problem in detail.
- Screenshots with the URL visible in them and the problem marked are more than welcome.
- Tell us how to replicate the problem, we can't fix it if we can't find it.
- Make sure that your site/server meets JomSocial System Requirements
- Make sure to setup JomSocial Cron Job
- Always provide us with access details to the backend and ftp. We need it to debug problems.
- If you have a similar problem, but a solution you found isn't working, open a new thread instead of 'merging' with an existing one.

- Use the "Thank You" feature on any post that helped you
9 years 8 months ago
  • jw's Avatar
    Topic Author
  • jw
  • Offline
  • Fresh Boarder
  • Posts: 34
  • Thank you received: 6
Licenses:
JomSocial Active

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.

9 years 8 months ago
Licenses:

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.


- Instead of saying: 'it's not working', explain the problem in detail.
- Screenshots with the URL visible in them and the problem marked are more than welcome.
- Tell us how to replicate the problem, we can't fix it if we can't find it.
- Make sure that your site/server meets JomSocial System Requirements
- Make sure to setup JomSocial Cron Job
- Always provide us with access details to the backend and ftp. We need it to debug problems.
- If you have a similar problem, but a solution you found isn't working, open a new thread instead of 'merging' with an existing one.

- Use the "Thank You" feature on any post that helped you
9 years 8 months ago
  • jw's Avatar
    Topic Author
  • jw
  • Offline
  • Fresh Boarder
  • Posts: 34
  • Thank you received: 6
Licenses:
JomSocial Active

Where and what is the function that does all this includes?

Making it myself is just 5 minutes work but saves me hours or even days of work (so its worth it). I hoped it was beter documented :(

9 years 8 months ago
Licenses:

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');

Then rest of template files are loaded by ROOT/components/com_community/templates/default/groups.index.php as variables (for example discussions list):
$discussionsHTML

that are declared back in ROOT/components/com_community/views/groups/view.html.php (line 1976)
$discussionsHTML = $tmpl->set('discussions', $discussions)
                    ->set('groupId', $group->id)
                    ->fetch('groups.discussionlist');

so in result it loads:

ROOT/components/com_community/templates/default/groups.discussionlist.php

And this is common for ALL Joomla! extensions.


- Instead of saying: 'it's not working', explain the problem in detail.
- Screenshots with the URL visible in them and the problem marked are more than welcome.
- Tell us how to replicate the problem, we can't fix it if we can't find it.
- Make sure that your site/server meets JomSocial System Requirements
- Make sure to setup JomSocial Cron Job
- Always provide us with access details to the backend and ftp. We need it to debug problems.
- If you have a similar problem, but a solution you found isn't working, open a new thread instead of 'merging' with an existing one.

- Use the "Thank You" feature on any post that helped you
9 years 8 months ago
  • jw's Avatar
    Topic Author
  • jw
  • Offline
  • Fresh Boarder
  • Posts: 34
  • Thank you received: 6
Licenses:
JomSocial Active

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?

9 years 8 months ago
Licenses:

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


- Instead of saying: 'it's not working', explain the problem in detail.
- Screenshots with the URL visible in them and the problem marked are more than welcome.
- Tell us how to replicate the problem, we can't fix it if we can't find it.
- Make sure that your site/server meets JomSocial System Requirements
- Make sure to setup JomSocial Cron Job
- Always provide us with access details to the backend and ftp. We need it to debug problems.
- If you have a similar problem, but a solution you found isn't working, open a new thread instead of 'merging' with an existing one.

- Use the "Thank You" feature on any post that helped you
Moderators: Piotr Garasiński
Powered by Kunena Forum

Join 180,000 websites creating Amazing communities

JomSocial is the most complete, easy-to-use addon that turns Joomla CMS into a
full -fledged, social networking site

TRY NOW BUY NOW