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

Options Box + Template Modification

Discussion in 'XenForo Development Discussions' started by BamaStangGuy, Jul 18, 2013.

  1. BamaStangGuy

    BamaStangGuy Well-Known Member

    I want to create an addon that does the following:

    Create an Options Group
    Have two fields in the options group:

    One field will have an html link.
    The other field will be a box where I can throw a bunch of random things in there (javascript for example)

    I want to attach both fields to a template modification.

    So for example in field one I would attach it someone in the footer template.

    Field two would be appended to the end or near the end of the footer template.

    My question is is this the best method of doing this for the future? Basically, the first field will be a link to me company website and will attach it next to the xenForo copyright.

    The second field will contain certain javascript such as Quantcast, Skimlinks, Vibrant Media, etc etc.

    I have many sites and want to use this addon as a way to easily streamline adding this content, which is basically the same across all sites, to each site.

    Any ideas on best approach to this?
  2. Chris D

    Chris D XenForo Developer Staff Member

    Could you just create a new, blank XenForo add-on and apply your template modifications to that using the 1.2 TM system? And then just export that add-on and install it on all of the other sites?
  3. BamaStangGuy

    BamaStangGuy Well-Known Member

    I could do that for Quantcast and the company url but not for the Vibrant Media, Skimlins and other javascript that append different ids to their javascript. I would have to manually edit those modifications.

    My idea would just be a simple text box and then have that talk to the 1.2 TM. My addon would be simple enough it would only mess with the footer template so nothing to crazy.
  4. Chris D

    Chris D XenForo Developer Staff Member

    Well, yeah, you could create the option and assign it to the aforementioned add-on you can create. Admin CP > Development > Create add-on -- you can leave most of the text boxes blank. It just needs an addon ID and title and version numbers.

    When you create an option, you can assign it to an ID set it up as a text box and assign it to your add-on.

    You can then reference it directly in your template modification, like this: {$xenOptions.yourOptionsId}
    BamaStangGuy likes this.
  5. BamaStangGuy

    BamaStangGuy Well-Known Member

    Awesome, that helps a lot.

Share This Page