1. 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 1.0.0

This tutorial will go over how to package a template modification as an add-on.

  1. 0ptima

    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.

    Read more about this resource...
     
    Mian Shahid and Markos like this.
  2. Mian Shahid

    Mian Shahid Well-Known Member

    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:
    [​IMG]
     
  3. Enguerran A

    Enguerran A Well-Known Member

    Nice tip, I'll use it for sure in my next update :)
     
  4. 0ptima

    0ptima Well-Known Member

    I do not know.
     
  5. Steve F

    Steve F Well-Known Member

    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.
     
    Mian Shahid likes this.
  6. 0ptima

    0ptima Well-Known Member

    @Steve F How do you reference a string of forums ids like "10,15,20,30" in the template?
     
  7. Steve F

    Steve F Well-Known Member

    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>
    
     
    Mian Shahid and Diesalot like this.
  8. 0ptima

    0ptima Well-Known Member


    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.
     
  9. 0ptima

    0ptima Well-Known Member

    I added a couple of additional examples.
     
    Mian Shahid likes this.
  10. Mian Shahid

    Mian Shahid Well-Known Member

    How can we place these input numbers
    [​IMG]
    at position of $0
    [​IMG]

    anyone who knows?
     
  11. developr

    developr Member

    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?
     

Share This Page