News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Adding theme options to the Adminstration Center

Started by tallman, March 07, 2005, 10:49:30 AM

Previous topic - Next topic

tallman

I have a theme where I want to add the ability to modify the header text via the Administration Center. Currently you have to modify index.template.php, but I want to be able to do it through the Administration Center. Actually, this applies to any theme-specific option. Any tips/guidelines?

Trekkie101

Header text?

Look at server settings

Also to edit the index.template look in the theme area you can modify it while using your board.

ryanbsoftware

Quote from: tallman on March 07, 2005, 10:49:30 AM
I have a theme where I want to add the ability to modify the header text via the Administration Center. Currently you have to modify index.template.php, but I want to be able to do it through the Administration Center. Actually, this applies to any theme-specific option. Any tips/guidelines?


I have seen this done with a theme before.

Apollo design by Bloc had that?  Bloc would be able to answer your question. ;)

dustrho

Bloc has something like this for his Helios theme.  Is this what you're talking about?


tallman

Quote from: dustrho on March 07, 2005, 01:29:58 PM
Bloc has something like this for his Helios theme.  Is this what you're talking about?



Yes, that is exactly what I'm taking about.

ryanbsoftware

thats what i thought, so now their are two themes that have that both by Bloc, i think he would be the one to know, him or a SMF developer. ;)

tallman

I downloaded Bloc's Apollo theme and checked out the code. Basically, it boils down to copying the Themes.template.php file from the default theme to your own theme directory and modifying the template_set_settings function. Then you can access the option as needed in you index.template.php file.

[Unknown]

Actually, it has more to do with Settings.template.php...

-[Unknown]

Apnomis

I've been experimenting with expanding the admin console to change template features also, as Unknown says you need to edit your settings.template.php file to include a new option, for example a text box, then in the index.template.php file where you're currently writing the header to reference the text that is entered in the theme settings. It's actually quite straight forward (it must be if I could work it out!!!)

Here's a topic I started the other day when I was having trouble working out how you get the index.template.php file to reference the entry in the settings, it should make it more obvious what you need to do:

http://www.simplemachines.org/community/index.php?topic=30307.0

bloc

You
Quote from: tallman on March 07, 2005, 02:35:56 PM
I downloaded Bloc's Apollo theme and checked out the code. Basically, it boils down to copying the Themes.template.php file from the default theme to your own theme directory and modifying the template_set_settings function. Then you can access the option as needed in you index.template.php file.

You could do it like that, adding more fields there..but that is if you need some special layout/form element. If you just use single-line textboxes or tick boxes - or even a list, just add your own to the Settings.php, like [Unknown] mentioned.

Do you need a walkthrough?

Advertisement: