Help adding a custom field into the cms

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
Sid3335

Help adding a custom field into the cms

Post 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
Duketown

Re: Help adding a custom field into the cms

Post 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)
Sid3335

Re: Help adding a custom field into the cms

Post 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
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Help adding a custom field into the cms

Post 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}
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Locked

Return to “CMSMS Core”