XF 1.2 How can I export my custom "Template Modifications" ?

Chris D

XenForo developer
Staff member
In Debug mode you can create an add-on and you can assign a template modification to an add-on. Then you can export that add-on (which creates an XML).

That XML file will then be installable as an add-on elsewhere and it will install those modifications.
 
Reactions: rdn

rdn

Well-known member
In Debug mode you can create an add-on and you can assign a template modification to an add-on. Then you can export that add-on (which creates an XML).

That XML file will then be installable as an add-on elsewhere and it will install those modifications.
Is there any guide here to create a basic addon just like this?
 

Chris D

XenForo developer
Staff member
Just go to the Development tab > Create Add-on > Then just fill in the Add-on ID, Title, Version String and Version ID. That creates an add-on.
 
Reactions: rdn

rdn

Well-known member
After creating my addon here: /admin.php?add-ons/add
No others things to do?
Like:
  • Code Events
  • Code Event Listeners
etc...
 

Chris D

XenForo developer
Staff member
That's right...

Though TMC isn't really accurate. It's a Template Modification, so calling it a TMC isn't really correct.
 

rdn

Well-known member
Oppz. I cannot assign multiple Template Modification into a single addon?
If I remember, TMS can include multiple modification on a single addon.

I got this error when adding more modification:
Code:
Mysqli prepare error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DISTINCT template.* FROM xf_template_map AS template_map INNER JOIN xf_t' at line 1
 

Chris D

XenForo developer
Staff member
Hm. Do you still have TMS installed?

You should be able to make as many template modifications to a single add-on as you like. I've not seen this error before.

What version of XenForo 1.2 are you running?
 

Jeremy

Well-known member
@RoldanLT, you should post in the TMS thread to report bugs. It most likely will help others and get more attention from the developer.
 
Reactions: rdn

Chris D

XenForo developer
Staff member
Where does this data come from? Is it just made up?
Add-on IDs need to be unique so it shouldn't match one you already have installed nor should you name it something common that another developer might use or have already used, the title should be of your choosing, the version string is whatever you like; e.g. 1.0.0, version ID is just a basic number just use whatever convention you like; e.g. 1 and the rest of the fields you can most likely ignore.

How does one actually assign the modification?
In Debug Mode, a drop down list is available while creating the TM. You can select your add-on there.

Then, when the add-on is exported, the XML file will contain the TM so it can be installed as an add-on elsewhere.
 

Neil E.

Active member
Thanks Chris, quick answer. This support forum is awesome. If I only had a tiny percentage of the abilities around here, I'd be golden.
 
Last edited:

Neil E.

Active member
In Debug Mode, a drop down list is available while creating the TM. You can select your add-on there.
What about existing TMs? Any way to select an addon for them?

Question:
One thing I'd like to verify is that there is only ever one single list of template modifications, correct? So if several addons use many TMs and I have quite a few myself, the list will be massive? Is there any method for grouping (streamlining) the template modification list?
 
Top