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

Create and using an option to be used by multiple add-ons

Discussion in 'XenForo Development Discussions' started by farang, Dec 30, 2015.

  1. farang

    farang Well-Known Member

    Hi there!

    What if one of my add-ons needs to create and use an option in ACP. I create an option and assign it to my first add-on.

    Then I create another add-on that needs to use the same option... It wont get auto created if it doesn't exist because that option is only associated with the first add-on. Another problem is that if I uninstall the first add-on the option will be removed.

    I'm not sure if I could explain clear but I hope you get what I mean. Is there a solution for this?
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    I can't see there being a solution for this.
     
    farang likes this.
  3. Cyb3r

    Cyb3r Well-Known Member

    The only thing I can think of is to create a base or parent add-on and require it to be installed for your other add-ons to work properly, in your case it could be a simple XML file which can be included with all child add-ons.
     
    farang likes this.
  4. farang

    farang Well-Known Member

    Thanks guys!
     
  5. Daniel Hood

    Daniel Hood Well-Known Member

    Another potential solution, though messy, is to make the installer of each add-on look to see if the option id exists. If it doesn't, create it. Seems kind of rigged though. The parent add-on idea is probably best.
     
    farang likes this.

Share This Page