Good practice for theme settings?

I’m working on a theme that will allow the user (me) to easily change theme settings. For example the URL to the image that will be displayed in the header, meta data that will be used to fill out the meta tags, maybe also design-related settings that will be inserted as a CSS-style-element in the document head.

Is there a best practice to do that? I wanted to use the site.txt file where the user can conveniently add fields that I can check for and access in my templates. But theoretically, you could also use the config.php file and retrieve the options using the c::get method. Or maybe there is even another way?

What is the best way to allow for user settings in a theme this? Does it differ depending on what kind of settings I want?

(Or is there even an easy way to build a theme options-page for the panel/backend and store the options in another file?)


Yes, that depends on who should be able to change these setting. All settings that need to be accessible to non-technical people who only have access to the panel, should go into site.txt.

All other stuff can go into the config file.

1 Like

See also this topic

1 Like