Creating a Template Based Add-On

Creating a Template Based Add-On 1.0.0

No permission to download

0ptima

Well-known member
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...
 
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:
mXMZBKj.png
 
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:
mXMZBKj.png

You can add options like so while viewing the Options screen

upload_2014-5-31_16-58-58.webp

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.
 
I think you can do something like below, not absolutely positive of the syntax.

Rich (BB code):
<xen:if is="in_array({$forum.node_id}, array({$xenOptions.YourOptionId}))">
Do Stuff
</xen:if>
 
I think you can do something like below, not absolutely positive of the syntax.

Rich (BB 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.
 
I think you can do something like below, not absolutely positive of the syntax.

Rich (BB 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
DBZO27V.png

at position of $0
KVA6uwr.png


anyone who knows?
 
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?
 
Top Bottom