Tony, I think the original query was to have a colour in different blocks rather than all of them.
Dutyman, there is a way to do this.
First backup "blocks/block_custom.php" and replace it with the attached one. This creates a new custom_id call {custom_id} for passing to the templates.
Now copy the attached "block_simple.html" and "block_custom.html" into your layout templates folder. This adds a new id of "bl_{custom_id}" - the "bl_" is to make the id unique on the page.
Lastly add to the css styles file and for each block you want to colour, at the end add..........
.bl_custom#bl_N{background: #DD0000;} /* for blocks with titles */
.bl_simple#bl_N{background: red;} /* for blocks without titles */
........where "N" is the number of the block ID you wish to colour from "Administration > CMS > Custom Blocks".
You can obviously move the new id around on the templates pages to suit your requirements, for example move it down into the table "block" class.
TOCDCO
4 Aug 2008 3:13 PM
Hey, thanks Ned. I've actually been doing this manually via Expression web and moving over the html. This helps tremendously!!
This idea can also be applied to the backgrounds of the index and individual custom pages.
For Custom Pages backup and replace "blocks/block_custom_page_body.php" with the attached file. This takes the $page_id variable and creates a new variable called {page_custom_id} for passing to the templates.
You then need to change "templates/(yourlayout)/page.html" at line 16 to
<body class="commonbg" id="pg_{page_custom_id}">. The "pg_" prefix is to make the id unique on the page.
The styles/(yourlayout).css file already has
.commonbg ( etc..
which provides the background to the index page and all others.
So to over-ride the backgrounds in other custom pages add:
commonbg#pg_N{background: #DD0000;}
.......where "N" is the number of the page ID you wish to colour from "Administration > CMS > Custom Pages".
Last modified: 16 Aug 2008 8:38 AM
TOCDCO
8 Aug 2008 2:57 PM
Thanks Ned.
This is why we need to create our own group manual of all of the things we've come up with and help defining the manual.
Dan
gotmeawebsite
15 Aug 2008 12:19 PM
Wow this sure helps..
I am planning on designing some custom templates for my store and this goes a long way to help with the efforts I am trying to get done.
SajMalik
15 Aug 2008 2:43 PM
Dan - just what went through my mind - a couple of weeks and this is all lost and when it gets raised again we all go searching through the threads trying to find it.
Or Ned has to keep a portfolio of his great responses to keep dishing out
beerfan (Guest)
14 Feb 2009 2:56 PM
One question when trying to add the block and page body scripts. Are you supposed to delete the previous code in the css or add it? I have added it and am not able to see any changes due to the settings associated with "commonbg" and the block background.
TOCDCO
14 Feb 2009 7:49 PM
What version are you using?
What type of block is it? All of them, or an individual one?
Ned
15 Feb 2009 9:50 AM
You should add the code to the .css file. Your web browser will start at the top of the file and add or amend styles as it progresses down the file.
So if you declare a style you can redeclare it later.
Do however remember when changing .css files that you must reload or refresh the page you are viewing so that the new version of the .css file is used.
As before if you are a Windows user there is Stylizer at http://www.skybound.ca/ which others have found of great help.
/******Block Background - Individual, where N equals custom block number from ADMIN*****
.bl_custom#bl_51{background: #781213;} /* for blocks with titles */
.bl_simple#bl_51{background: #781213;} /* for blocks without titles */