Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...What is the best way to change a style element at the page level?What is the best way to change a style element at the page level?
Previous
 
Next
New Post
8/13/2009 11:46 AM
 

My client would like a different specific background color for each page. The skins are otherwise identical. If possible I would like to avoid stamping out a new skin for each of the many colors.

I could place a overriding style element in a module.

<style>
.somebackgroundclass {background:#FFFFFF;}
<style>

But placing style elements within the body tag of a page is a no-no and causes validation errors.

 Another thought is to create a small stylesheet for each color with the same name as the page and placing something like this in the skin.

<link type="text/css" rel="stylesheet" href="<%=SkinPath%>colors/<%=Portalsettings.TabName%>.css" />

This methods validates but makes it painful to add/change a color or add/change a page name. Too bad there isn't an unused page variable I could use for the page color.

Does anyone know of a clever way of modifying a style class at the page level?

 
New Post
8/13/2009 1:43 PM
 

Almost right ;-)

I would do it this way:

add this to a div containing the skin:

<div class="<%=Portalsettings.ActieTab.TabName.tolower%>" >

*your skin*

</div>

now address all the pages inside skin.css like this:

.home{background:#000;}

.about{background:#400;}

.projects{background:#800;}

.contact{background:#B00;}

etc.

 
New Post
8/13/2009 4:16 PM
 

Thanks, using the div method would have been better then creating separate stylesheets.

Using DNN 5.1.1, after some trial and error I found that the Page Setting's "Page Header Tags" field inserts its contents directly into the page header without any kind of wrapper. I always thought it inserted its contents into a "meta" tag.

Placing my style element into this field works like a charm.
 

 
New Post
8/15/2009 4:57 PM
 

*** Sorry, did not see that you did exactly that. Please ignore ***

I used the Header tags textbox in the page definitions like so:

 <style type="text/css">
Body
{
 background-color: red;}
</style>

This gives you a control of the body style per page.


Yehuda Tiram
AtarimTR
AtarimTR
972-2-5700114   |   972-54-4525492   |    http://www.atarimtr.co.il
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...What is the best way to change a style element at the page level?What is the best way to change a style element at the page level?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out