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

XF 1.4 Tips&Tricks. Anyone know how to find out which template to edit.

51463

Well-known member
#1
Is there an easy way to find out which template to edit when i want to edit something. But don't know which template to edit?

Let's say i want to add another button beside the "Preview" button. As shown in this picture below.

new.png

How would i find out? I right clicked on it "Inspect Element" But where exactly does it say which template it is.
I can't find it anywhere.


Me pressing Inspect
inspectt.png


Here is the code i get
code.PNG
 

Brentnauer

Well-known member
#2
I seem to recall an option that would output template names in HTML comments... I'm probably thinking of something else though. Would be nice to have an easy way to determine template names if not.
 

Chris D

XenForo developer
Staff member
#3
Something that may help:
upload_2014-9-22_23-51-41.png

Specifically, the line that starts with:
HTML:
<div id="content"
Notice the class name in that element is "thread_view". That class name will always be the main content template for the page you're viewing.

So, if you do that on the thread_create page, the class name will be "thread_create", therefore the particular Preview button you demonstrated in your screenshot will be in the "thread_create" template... well, maybe... You can see if it is or not by trying to search that template for something that may be unique about the element you're looking for, e.g. I'd probably search for "PreviewButton"... however...

Obviously templates can include other templates. So bear that in mind. If you can't find what you're looking for in the main content template then look through the template for any lines that begin:
Code:
<xen:include template="