• 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

Dannymh

Active member
#1
Hi,

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.

Cheers
Dan
 

Snog

Well-known member
#2
Check library/XenForo/Model/ThreadPrefix.php for the different methods of obtaining the thread prefixes.
 

Dannymh

Active member
#3
Check library/XenForo/Model/ThreadPrefix.php for the different methods of obtaining the thread prefixes.
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:

Snog

Well-known member
#4
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.