close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

background color

Thread began 1/16/2010 1:11 pm by gruant2000381341 | Last modified 2/04/2010 5:44 am by gruant2000381341 | 3177 views | 10 replies |

gruant2000381341

background color

how can i change the background color ? not like just around the text block...but for the entire background.

I guess I better add this.. I am not looking to change "just the general look for asthetics on the edit contents page"...what i want is to allow the user to have the color change applied to the actual page they are editing

Sign in to reply to this post

shadow329043

I think that all the styling is in the CSS files

Sign in to reply to this post

gruant2000381341

is there a way to change that dynamically ? I want it as more of an option as opposed to a preset.

I have found some javascript which works on changing div tag background color, but I don't know how to "add it into" my powercms so that the edited page will pick up that background color variable.

Sign in to reply to this post

shadow329043

Don't know how extensive a mod that would have to be - maybe one of the tech engineers will answer that one.

Sign in to reply to this post

neilo

You could do it by placing a body background colour style inside the head of the page and entering the CMS generated code inside it (removing the space before and after the code). Assuming the page is 'index.php', and you have called the edit region 'Page Colour', it would look like this:

<style type="text/css">
<!--
body {
background-color:<?php
include('/path/to/your/site/yoursite.comk/CMS/WA_CMS/addtosite.php');
echo WA_getCMSContent($database_localhost, $localhost, 'index.php' , 'Page Colour');
?>;
}
-->
</style>




As PowerCMS by default seems to insert <p> </p> round anything you type in, you would have enter the code in 'Source' view (HTML Editor 'Source' button) and type the colour in there - otherwise the <p> tags will stop it working.

You would enter either 'white' 'black' 'gray' 'red' 'blue' etc, or a hexidecimal number (including hash) i.e. #FFFFFF #000000 #999999 etc. You would have to trust that your clients aren't going to type in, "Reddish-brown, with a hint of peach".

I'm not sure I am man enough to let a client loose with page background colours on my designs though!

Perhaps I'm over-complicating it though. There must be away to add it to the HTML editor stylesheet (except you can't select the 'body' tag).

Sign in to reply to this post

gruant2000381341

?? okay

Wow, I thought I paid just as much for this product as everybody else. And yet, nobody from WA can even bother if there is a way to achieve the result I need. Thats great

Sign in to reply to this post

Jason ByrnesWebAssist

gruant,

So you want to be able to modify the body's background color? you are going to have to rely on your client ot be a little css savvy for this. but you could create a new contentArea for each page named "BodyStyle". In that content area, go to code view and enter an inline background style to be used by the body tag such as:

style="background-color: red;"





then edit the body tag to add the developer notes:
<body <?php echo WA_getCMSContent($database_localhost, $localhost,"testpage", "bodystyle"); ?>>

I guess you could even just have them type the color name for the content area:
"red"


and edit the body tag to place the CSS in front of it:
<body style="background-color:<?php echo WA_getCMSContent($database_localhost, $localhost,"testpage", "bodystyle"); ?>">

either way, this is relying on the client to enter a valid color css color name.

Sign in to reply to this post

neilo

You would also have to advise your client to choose colours different enough from those of the a:link, a:visited, and a:hover states or else add a way for him/her to change those too, otherwise links may seem to disappear. Even if you don't specify those, usually by default they are blue for links and maroon/mauve for visited.

What might be a more manageable solution could be - once your site is developed - to duplicate your main stylesheet (say) three times so you have styles1.css, styles2.css and styles3.css.

Then in each of the two (or more) new stylesheets change the style for background colour, link states, text colour, and any individual element properties, giving three (or more) defined page styles (themes) to choose from.

The CMS code would go in the head, like:

<link href="<?php
include('/home/users/uks66586/html/pictuality.co.uk/CMS/WA_CMS/addtosite.php');
echo WA_getCMSContent($database_localhost, $localhost, 'switch styles' , 'head css');
?>.css" rel="stylesheet" type="text/css" />



And the user would just need to enter 'style1', 'style2' or 'style3' into the alloted CMS area edit. They would just need to be literate for that.

So this page is just one page but with a choice of three stylesheets that can be put in the head by the CMS. At least it would be, if you had access to my CMS. Because you can't, the demo is three copies of the same page, identical, but for the stylesheet name in the head.

Sign in to reply to this post

Jason ByrnesWebAssist

Yes, that is an excellent way to do it as well.

Nicely done expanding on the concept I suggested, Neilo.

Sign in to reply to this post

neilo

Cheers Jason.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...