• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

[Already Exists] Template Name Comments in when viewing source HTML

#1
I am not sure if this has been requested already. I tried searching but did not see any related threads.

This suggestion is simple. Basically when we view the source code of a page in vB (with "Add Template Name in HTML Comments" it shows all the template names and it becomes easy for an admin to modify a particular template to achieve a certain effect.

However with Xenforo, it is pretty difficult to modify the templates, without actually knowing which template to edit.

Can this feature be added? Or is it already available and I did not look properly in the admin CP ?
 

James

Well-known member
#2
You can find out the template by looking for the div with an ID of content and looking at the class name.

For example, for this page:
Code:
<div id="content" class="thread_view">
Therefore, the template is thread_view.
 
#3
You can find out the template by looking for the div with an ID of content and looking at the class name.

For example, for this page:
Code:
<div id="content" class="thread_view">
Therefore, the template is thread_view.
Really? Is that true for each and every template? I haven't even tried to modify any templates in Xen yet, so sorry if I am asking for the obvious
 

James

Well-known member
#4
Yeah, that's true.

Check the index - <div id="content" class="forum_view">

The class of the div with an ID of content is the template you edit.
 
#5
For eg: the forumhome page in Xenforo, I have no idea which template to edit, cuz it does not show the template name anywhere. The page begins with <html ... blah blah !!

Where as in vB at the top it clearly shows "Template FORUMHOME"
 

James

Well-known member
#7




Etc, etc.

It's confusing to begin with, but once you've got the hang of it it's a lot easier to just Ctrl + F -> id="content" than flick on/off the ACP option.
 
#9
This seems to have changed and the templates can no longer be identified this way, at least not in the latest version (1.3.3). Does anyone else know of another way to find the templates beginning/end in the source code?
 

Brogan

XenForo moderator
Staff member
#12
Look at the contents of the thread_view template to see how it works and how many other templates are called (included).
 
#13
I see. I was looking for something to indicate the beginning and ending of each template, as they're rendered or included in the page, the same way VB does it. I guess multiple <divs with the same ID wouldn't make much sense. I should have spotted that.