• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Creating a Template Based Add-On

Creating a Template Based Add-On 1.0.0

No permission to download

0ptima

Well-known member
#1
0ptima submitted a new resource:

Creating a Template Based Add-On - This tutorial will go over how to package a template modification as an add-on.

If you need to edit a XenForo template, you can either edit the template directly or use the built-in template modification system. With the template modification system, you can package template modification(s) as an add-on, export it from the source forum and import it into different forums or share the modifications with others.

This tutorial will go over how to package a template modification as an add-on and will use the template modification in the following...
Read more about this resource...
 

Mian Shahid

Well-known member
#2
Fantastic work @0ptima, this is i really searching since a while.

One question: how to add an option in add-on like below pointed in red to get input number of node id or user id or something else like that:
 

Steve F

Well-known member
#5
Fantastic work @0ptima, this is i really searching since a while.

One question: how to add an option in add-on like below pointed in red to get input number of node id or user id or something else like that:
You can add options like so while viewing the Options screen

upload_2014-5-31_16-58-58.png

As for node_id or user_id it would depend on how you are wanting to use it. Simple things can be achieved with some conditionals in the templates.
 

0ptima

Well-known member
#8
I think you can do something like below, not absolutely positive of the syntax.

Code:
<xen:if is="in_array({$forum.node_id}, array({$xenOptions.YourOptionId}))">
Do Stuff
</xen:if>

This does not work with a string. I believe in order for this to work, the string of forum IDs would need to be converted into an array first.
 

Mian Shahid

Well-known member
#10
I think you can do something like below, not absolutely positive of the syntax.

Code:
<xen:if is="in_array({$forum.node_id}, array({$xenOptions.YourOptionId}))">
Do Stuff
</xen:if>
This does not work with a string. I believe in order for this to work, the string of forum IDs would need to be converted into an array first.
How can we place these input numbers

at position of $0


anyone who knows?
 
#11
If I would like to create a tms it is only possible to change templates of master-style, but not for substyles.

How can I use it to autochange templates of substyles?