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

Discussion in 'Closed Suggestions' started by silendreamer, Feb 16, 2011.

  1. silendreamer

    silendreamer Active Member

    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 ? [​IMG]
     
  2. James

    James Well-Known Member

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

    silendreamer Active Member

    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 [​IMG]
     
  4. James

    James Well-Known Member

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

    silendreamer Active Member

    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"
     
  6. silendreamer

    silendreamer Active Member

    Isn't that a little complicated for newbies trying to start using Xen :(
     
  7. James

    James Well-Known Member

    [​IMG]

    [​IMG]

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

    Brogan XenForo Moderator Staff Member

    I'm moving this to implemented as the feature already exists.
     
  9. Jeff Mezick

    Jeff Mezick Member

    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?
     
  10. Brogan

    Brogan XenForo Moderator Staff Member

    The functionality is the same.
    Nothing has changed.

    upload_2014-7-10_21-23-31.png
     
  11. Jeff Mezick

    Jeff Mezick Member

    If you view the source of this page, <div id="content" only occurs once, in the example you showed. This page uses only one template?
     
  12. Brogan

    Brogan XenForo Moderator Staff Member

    Look at the contents of the thread_view template to see how it works and how many other templates are called (included).
     
  13. Jeff Mezick

    Jeff Mezick Member

    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.
     

Share This Page