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

XF 1.2 How can I export my custom "Template Modifications" ?

Discussion in 'XenForo Questions and Support' started by RoldanLT, Jun 25, 2013.

  1. RoldanLT

    RoldanLT Well-Known Member

    I tried enabling debug mode, still I can't see any export button.
    :unsure:
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    In Debug mode you can create an add-on and you can assign a template modification to an add-on. Then you can export that add-on (which creates an XML).

    That XML file will then be installable as an add-on elsewhere and it will install those modifications.
     
    RoldanLT likes this.
  3. RoldanLT

    RoldanLT Well-Known Member

    Is there any guide here to create a basic addon just like this?
     
  4. Chris D

    Chris D XenForo Developer Staff Member

    Just go to the Development tab > Create Add-on > Then just fill in the Add-on ID, Title, Version String and Version ID. That creates an add-on.
     
    RoldanLT likes this.
  5. RoldanLT

    RoldanLT Well-Known Member

    After creating my addon here: /admin.php?add-ons/add
    No others things to do?
    Like:
    • Code Events
    • Code Event Listeners
    etc...
     
  6. RoldanLT

    RoldanLT Well-Known Member

    And then assign TMC on that addon, OK.
    Thanks !
     
  7. Chris D

    Chris D XenForo Developer Staff Member

    That's right...

    Though TMC isn't really accurate. It's a Template Modification, so calling it a TMC isn't really correct.
     
  8. RoldanLT

    RoldanLT Well-Known Member

    Built-in TMC :)
    Is Add-on ID, numeric? or anything will do?
     
  9. RoldanLT

    RoldanLT Well-Known Member

    Oppz. I cannot assign multiple Template Modification into a single addon?
    If I remember, TMS can include multiple modification on a single addon.

    I got this error when adding more modification:
    Code:
    Mysqli prepare error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DISTINCT template.* FROM xf_template_map AS template_map INNER JOIN xf_t' at line 1
     
  10. Chris D

    Chris D XenForo Developer Staff Member

    Hm. Do you still have TMS installed?

    You should be able to make as many template modifications to a single add-on as you like. I've not seen this error before.

    What version of XenForo 1.2 are you running?
     
  11. RoldanLT

    RoldanLT Well-Known Member

    Yes, I have the latest TMS from github.
    Wait, I'll try to disable it.
     
  12. RoldanLT

    RoldanLT Well-Known Member

    @guiltar I just disabled TMS and the error is now gone.
    Please take a look, Thanks !
     
  13. Jeremy

    Jeremy XenForo Moderator Staff Member

    @RoldanLT, you should post in the TMS thread to report bugs. It most likely will help others and get more attention from the developer.
     
    RoldanLT likes this.
  14. guiltar

    guiltar Well-Known Member

    Actually, I'm preparing importer from TMS to TMC.
    I fixed several obvious compability issues in github but not sure that it's all.
    Next version will be for 1.2 and higher and it will include importer.
     
  15. Neil E.

    Neil E. Active Member

    Where does this data come from? Is it just made up?

    How does one actually assign the modification?
     
  16. Chris D

    Chris D XenForo Developer Staff Member

    Add-on IDs need to be unique so it shouldn't match one you already have installed nor should you name it something common that another developer might use or have already used, the title should be of your choosing, the version string is whatever you like; e.g. 1.0.0, version ID is just a basic number just use whatever convention you like; e.g. 1 and the rest of the fields you can most likely ignore.

    In Debug Mode, a drop down list is available while creating the TM. You can select your add-on there.

    Then, when the add-on is exported, the XML file will contain the TM so it can be installed as an add-on elsewhere.
     
  17. Neil E.

    Neil E. Active Member

    Thanks Chris, quick answer. This support forum is awesome. If I only had a tiny percentage of the abilities around here, I'd be golden.
     
    Last edited: Aug 18, 2014
  18. 0ptima

    0ptima Well-Known Member

    Neil E. likes this.
  19. Neil E.

    Neil E. Active Member

    What about existing TMs? Any way to select an addon for them?

    Question:
    One thing I'd like to verify is that there is only ever one single list of template modifications, correct? So if several addons use many TMs and I have quite a few myself, the list will be massive? Is there any method for grouping (streamlining) the template modification list?
     
  20. 0ptima

    0ptima Well-Known Member


    Create an addon, edit the template modification and assign it to your addon.
     
    Neil E. likes this.

Share This Page