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

When do you create an addon instead of a simple template edit?

Discussion in 'XenForo Development Discussions' started by Marcus, Feb 25, 2012.

  1. Marcus

    Marcus Well-Known Member

    There are lots of situations where I am undecided whether I just do a template edit, or write an addon that puts a new template into a template hook. Do you prefer to just do template edits or do you prefer to create an addon for that?

    I like the idea of just using a stock xenforo with only as few template edits as possible.
  2. Fuhrmann

    Fuhrmann Well-Known Member

    I always try to not do template edits. What I have done in my own forum was to create only one add-on to do all changes that I need to do.
    Marcus likes this.
  3. digitalpoint

    digitalpoint Well-Known Member

    It's a tradeoff really... Addon/hook location means you don't need to muck with the template on upgrades if that template was changed in the master. The downside is it's slightly slower since it has the overhead of needing to go through the event listener system.

    When I *do* do direct template edits that are just adding something, I tend to make my own template with the addition, and then do in a template include... that way the edit to the master template is minimal:

    <xen:include template="my_custom_template" />
    Morgain likes this.
  4. Morgain

    Morgain Well-Known Member

    Thats what I like too.
    Jon is starting to teach me a way to collect all my sidebar includes in one additional template which will be good for upgrade too. (Not with a listener)
  5. Yoskaldyr

    Yoskaldyr Well-Known Member

    There was created Template Modifications System for XenForo so you can make such modifications without touching templates

Share This Page