Page 1 of 1

Help adding a custom field into the cms

Posted: Thu Oct 11, 2007 9:12 am
by Sid3335
Hi Guys:

Been trying for a while to do this, and been having problems.

In the CONTENT->PAGES->OPTIONS  i want to add in another field called bg_colour which will insert the page bg colour into the template for each page dynamically.

i tried the chat with no luck.

surely cms made simple can allow you to add another field in?? it can't be that difficult, but i'm having problems following the trail as to where everything is done.

can someone please help, its the last part i need to complete to sign off this site.

thanks

Re: Help adding a custom field into the cms

Posted: Thu Oct 11, 2007 10:46 am
by Duketown
Sid3335,

For what I know, CMS Made Simple is stylesheet driven. This means that you set up mulitple stylesheets (one for each background) and connect it to a template (thus you will need multiple templates each for one background color you want). Next to this, you would link per page the correct template. This means you can have one page with background green and the other in blue, simple by changing the template.
This is a little bit of additional setup in the beginning, but far more better, then to update the program that make maintenance and addition of pages possible. Using the stylesheet/template situation will not cause any problems during an upgrade.

Duketown

PS. For those amongst us that have more experience with the stylesheets and I have not been clear enough to Sid3335, please reply (for my learning curve  ;D)

Re: Help adding a custom field into the cms

Posted: Thu Oct 11, 2007 10:50 am
by Sid3335
hi thanks for the reply

not sure the client would want to take these steps each time they want to change a bg color.

surely it can't be overly difficult to add in a new option

Re: Help adding a custom field into the cms

Posted: Thu Oct 11, 2007 2:26 pm
by calguy1000
use a separate content block in your page template like this:

Code: Select all

{literal}<style type='text/css'>
body {
   background-color: {/literal}{content block='bgcolor' oneline='true'}{literal}
}
</style>{/literal}