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, ...Automatically change header imageAutomatically change header image
Previous
 
Next
New Post
4/21/2011 1:24 PM
 

Hello All,

I would like to dynamically change my page header graphic so that certain pages/sections swap out the default image.
That way each 'department' page and its child pages use an assigned image (and possibly text).
Unfortunately I can't count on my page editors to consistently pick a template or having access to an editable module for it.
I really need this to happen automatically (once I set up the correlations of course).

So far all I can think of is some code that looks for key words in the URL and updates the CSS element.

Any ideas or Examples??

Thank for any input, CD

 
New Post
4/21/2011 5:19 PM
 
I am now wondering if 40Fingers "Style Helper Skin Object" can do this?

http://dnnskinextensions.codeplex.com...
 
New Post
4/22/2011 4:23 AM
 
Yes is should be able to do that for you if you use a background image.
How could you make a distinction between the departments?
On page name or do they have a different domainname?

Let's say you would have a Root page for each department.
In that case I would use the bodyclass attribute and use this HTML / CSS.
Set this for the skin object:
AddBodyClass="True"
BodyClass = "[BcName]"


Now add this HTML for the image
<div id="MyUmage></div>

And thi s css to skin.css
#MyImage {width:500px; height:200px;}
.L0_Department1 #MyImage{background: url(img/Department1.png) no-repeat;}
.L0_Department2 #MyImage{background: url(img/Department2.png) no-repeat;}

etc.


 
New Post
4/22/2011 5:32 AM
 
If it's not a background image then I suggest a custom Logo skin object.

You can hack the supplied one very easily.  It's in admin\skins\logo.ascx in your DNN web site.  Drill down into admin\skins\logo.ascx.vb, find the lines of code (in Page_Load) that look like this...

 

If PortalSettings.LogoFile <> "" Then
    imgLogo.ImageUrl = PortalSettings.HomeDirectory & PortalSettings.LogoFile
Else
    imgLogo.Visible = False
End If
imgLogo.AlternateText = PortalSettings.PortalName

...and hack away.

For a production design I STRONGLY recommend extra steps. 1)Copy your skin to a new name so that when you next upgrade DNN you don't lose your changes. 2)Copy the Logo.ascx to a new name for the same reason, 3) adjust your copied skin to use the copied Logo.ascx 4) Apply the copied skin to the site.

It takes longer to write about than to do!



Best wishes,
- Richard
Agile Development Consultant, Practitioner, and Trainer
www.dynamisys.co.uk
 
New Post
4/22/2011 11:07 AM
 
Thank you both for your great ideas. You gave me two good starting points. Very appreciated.

Timo: I was hoping to sniff "PortalSettings.ActiveTab.BreadCrumbs(1).TabName" to see which Dept I was in.
Richard: Gawd! That is some really cool dark magic there. Thanks, that slant opens up a world other hackery too I bet.

Now if I can just to evade all todays "meetings" and hit the code. I'll let you know how this works out.
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Automatically change header imageAutomatically change header image


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