Customizing SMF > SMF Coding Discussion
Creating new settings template
phantomm:
I was wondering, how to make new template for setting page?
I want to show settings as <table>
Arantor:
Quite easily. A settings page template is just a regular template.
What normally happens is template_show_settings gets called (because of $context['sub_template'] = 'show_settings' in most functions), so if you change the content of $context['sub_template'] in your mod, it'll change the function that's called.
Alternatively, you can actually declare individual items as a callback, check out the anti-spam questions code, which is a setting type 'callback' and that calls a separate function to display the content.
Hard to suggest what's best for you to do without understanding what exactly you are trying to do. (Are you sure a table is the best method, for example?)
phantomm:
Well... I want to create mod that adds table with information about servers (game servers to be more specific).
I would like to have something like this: http://img809.imageshack.us/img809/78/tablemod.png
I'm very new in this so i looked at other mods with custom template in settings, but didn't help much :|
Arantor:
How much information per game server, exactly? The same fields per game server?
Where are you wanting to store all this information?
phantomm:
Every server will have 5 informations + enable check.
--- Quote from: Arantor on July 20, 2012, 01:20:33 PM ---Where are you wanting to store all this information?
--- End quote ---
I'm lost here, I was thinking that where are other mod settings saved - prefix_settings ?
Navigation
[0] Message Index
[#] Next page
Go to full version