I want to create several different SP dropdowns using a named template. Is it possible to only create one named template with the necessary code and then parse to it the necessary options/vaues from other SP's ?
Basically, I want to save time by using a single named template rather than creating a unique one for every single dropdown menu. Is this possible?
Yeah, for that, you would likely need a separate template for each different set of options.
You can include templates in templates, though; and you can also do foreach loops in the template. But the problem you will face, is that it isn't possible to build an array and pass it to another template.
You might be able to have a separate template for each SP, but include a template that contains common code, if that saves time.
Unfortunately, I think Style Properties are a little bit underpowered in this circumstance. Certainly what you want to do would be more likely to be possible with add-on options, but styles and add-ons are completely separate. e.g. You can assign options to add-ons and you can assign style properties to add-ons, but you can't assign options to styles.
There's one more thought I'm having but I haven't actually had a chance to test it, yet.
You can include PHP in templates via the xen:callback tag. In theory, you could call the PHP from the template, pass some parameters to it, and return a different template or, e.g. a different array of options based on those parameters.
Certainly would work with public templates in some fashion, haven't ever tested it in Admin templates.
That's a shame. I'll just have multiple templates for now. Hopefully they'll consider your suggestion as it seems very strange to me also.
Thanks for the help.
Oh, one last question actually - IPB has a very simple way of returning the list of categories & forums (nodes) into a multi-select HTML element. This then outputs an array of node ID's for the selected options. Do you know if anything like this exists within XenForo. Presumably, it would need a named template and then some template code to output the node list. Is that possible?