Simple Machines Community Forum

Customizing SMF => Graphics and Templates => Topic started by: tallman on March 07, 2005, 10:49:30 AM

Title: Adding theme options to the Adminstration Center
Post by: 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?
Title: Re: Adding theme options to the Adminstration Center
Post by: Trekkie101 on March 07, 2005, 11:39:14 AM
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.
Title: Re: Adding theme options to the Adminstration Center
Post by: ryanbsoftware on March 07, 2005, 12:40:26 PM
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. ;)
Title: Re: Adding theme options to the Adminstration Center
Post by: 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?

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.sandtroopers.com%2Fdustrho%2Ftheme_st_20050307.gif&hash=788059c26d0f71fdf9a447eee33c4cb1884464a2)
Title: Re: Adding theme options to the Adminstration Center
Post by: tallman on March 07, 2005, 02:01:00 PM
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?

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.sandtroopers.com%2Fdustrho%2Ftheme_st_20050307.gif&hash=788059c26d0f71fdf9a447eee33c4cb1884464a2)

Yes, that is exactly what I'm taking about.
Title: Re: Adding theme options to the Adminstration Center
Post by: ryanbsoftware on March 07, 2005, 02:17:33 PM
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. ;)
Title: Re: Adding theme options to the Adminstration Center
Post by: 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.
Title: Re: Adding theme options to the Adminstration Center
Post by: [Unknown] on March 14, 2005, 01:21:39 AM
Actually, it has more to do with Settings.template.php...

-[Unknown]
Title: Re: Adding theme options to the Adminstration Center
Post by: Apnomis on March 14, 2005, 10:18:44 AM
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
Title: Re: Adding theme options to the Adminstration Center
Post by: bloc on March 15, 2005, 11:46:32 AM
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?