Posts: 4
Threads: 2
Joined: Apr 2018
This is one of the best and simple CMS I discovered!
My question: Is it possible to give every page a different background color or even a complete new theme? I really like the possibility to edit the html but unfortunately I didn't saw an option to do that seperetaly for every page.
Thank you!
Posts: 109
Threads: 7
Joined: Nov 2012
(2018-04-30, 13:09:31)gsmoel Wrote: This is one of the best and simple CMS I discovered!
My question: Is it possible to give every page a different background color or even a complete new theme? I really like the possibility to edit the html but unfortunately I didn't saw an option to do that seperetaly for every page.
Thank you!
First install the addons i18n and i18n custom fields. Then you define a custom field named "backgroundcolor". Now you'll find in the "page options+" on "edit page" a field in which you type in the wanted background-color - e.g. red, #ff0000, rgb(255,0,0).
In your template write in the <head>-section this
Code:
<style>
body { background-color: get_custom_field('backgroundcolor'); ?>
</style>
Alex
Posts: 6,266
Threads: 181
Joined: Sep 2011
You can also use components if you plan on having a few or want to do dynamic code driven code.
Posts: 4
Threads: 2
Joined: Apr 2018
(2018-04-30, 18:36:24)Alexander_ Wrote: (2018-04-30, 13:09:31)gsmoel Wrote: This is one of the best and simple CMS I discovered!
My question: Is it possible to give every page a different background color or even a complete new theme? I really like the possibility to edit the html but unfortunately I didn't saw an option to do that seperetaly for every page.
Thank you!
First install the addons i18n and i18n custom fields. Then you define a custom field named "backgroundcolor". Now you'll find in the "page options+" on "edit page" a field in which you type in the wanted background-color - e.g. red, #ff0000, rgb(255,0,0).
In your template write in the <head>-section this
Code:
<style>
body { background-color: get_custom_field('backgroundcolor'); ?>
</style>
Alex
Thanks for reply Alex, I did everything you said but it didn't work. Do I have to do something else like different type customfield? I chose textfield... Or is it overwritten by the default css file of the theme? Please help me Thank you!
Posts: 1,928
Threads: 88
Joined: Apr 2010
Code:
<style>
body { background-color: <?php get_custom_field('backgroundcolor'); ?>;}
</style>
Posts: 3,491
Threads: 106
Joined: Mar 2010
The other "traditional" way that I see no one mentioned is having several templates in the theme.
- You make a copy of template.php to, say, template2.php
- Edit template2.php and make changes (insert your custom background css or whatever)
- Edit the page in which you want to change the background color and select template2.php instead of the default template.