XF 2.2 How do I know which template to modify?

CBI Web

Well-known member
This section of a thread written for v1.5 explains how to identify templates by looking for the <div id="content" class="..."> tag via the browser inspector or by viewing the source of a page.

In v2.2 this tag no longer exists.

I did see some references in the page source such as data-template="forum_list", but I also know that the PAGE_CONTAINER template is in there somewhere, yet I see no reference to it.

So what is the current way to identify templates?
 
xenforo devs have shared a bookmarklet in the past that works great. i have this saved in my browser which does work on 2.2.

javascript:(function(){XF.flashMessage($('html').data('template'), 6000)}())

just add a browser bookmark with this as the URL and click on it on the xenforo page you want to know the template for.
 
javascript:(function(){XF.flashMessage($('html').data('template'), 6000)}())
Cool, that's definitely a handy tool, thanks!

Maybe I'm not catching on to something though, since that bookmarklet still only tells me the main template used on a page. Going back to the PAGE_CONTAINER example, that particular template has a lot going on in it, yet it is referenced nowhere in any page source that I've checked.
I'm thinking of a forum software I used long ago that could show template names in the source code, and every single template that made up a page would be referenced in comment tags ( <!-- ... --> ).
I was hoping for something similar in XF.
 
What you’re looking for may be within another template referenced from page container. It may be in a macro generated in another template.

What is it you’re looking for exactly?
 
The PAGE_CONTAINER template is not used on the front end in that manner - it is literally a container for the pages which are served.

As above, what are you trying to accomplish?
 
What is it you’re looking for exactly?
As above, what are you trying to accomplish?

I used PAGE_CONTAINER as an example mostly, just because I happened to be looking around in it and wondered why it wasn't in the source. Aside from that there are various times I want to customize something, or want to know what's making certain things come together, and I try to find the associated template. I'm still learning the XF templating system, among other things, so please excuse my newbie questions, lol.

Wow.... I was one of the first to come to XF in 2010, but too many years away from it and I'm in neophyte status again.
 
Back
Top Bottom