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

Get a list of prefixes as an option in addon options

Discussion in 'XenForo Development Discussions' started by Dannymh, Feb 2, 2015.

  1. Dannymh

    Dannymh Active Member


    I am writing an addon which uses the thread prefix as a trigger for its action. At the moment in the settings I ask the user to enter the ID of the prefix, however that is a pretty clunky approach and I would like the user to select just one prefix from a selectable list in the options but can't figure out how to do that.

  2. Snog

    Snog Well-Known Member

    Check library/XenForo/Model/ThreadPrefix.php for the different methods of obtaining the thread prefixes.
  3. Dannymh

    Dannymh Active Member

    Thanks for the help, but I know how to obtain them within say an addon.

    It is more getting them in a list on the Admin >> Options, for that addon. I can not see how to do that
    Last edited: Feb 3, 2015
  4. Snog

    Snog Well-Known Member

    Getting them in the Admin area is the same as getting them anywhere else.

    You would need to create a callback and template to display them in your add-on options. Or at the very least create a callback and use a standard XF admin template like option_list_option_select.
    Dannymh likes this.
  5. Dannymh

    Dannymh Active Member

    ah ok thanks, I think I get it. Ill give it a spin and see.


Share This Page