News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Adding custom theme options

Started by mabley, June 11, 2018, 10:58:34 AM

Previous topic - Next topic

mabley

I am building my own theme. I'd like to add a field in theme options that site admins (aka me) can use to control a theme-based change.

Example: I want a field where I can insert board IDs so that I can use a different theme variant for that board. Related: Theme variant per board. I have some nice suggestions on how to do this by hand in the theme, but it'd be fun to figure out how to do it in the UI.

This is really an experiment, but I can't find documentation about adding custom theme settings. At the moment, my question is adding a theme option in general.

Thanks!

SMF Version: 2.0.15

Kindred

I swear that there was documentation on this as some point...

function template_options()
in Settings.template.php
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

mabley

Fantastic! Thank you. I'll play around with this.  ;)

Chen Zhen

Mess around with the attached mod.
It adds the board/theme options to:
Admin -> Modifications -> Board Themes

My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

Advertisement: