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, ...body id tagbody id tag
Previous
 
Next
New Post
10/8/2007 5:57 PM
 
Default.aspx sets the body tag to: body id="Body"...
Can I get DNN to set the id to equal the tabid, or a unique value per page?

If I could get the id of each page to be unique, then I could highlight the navigation button that corresponds to the page being viewed. (This is CSS navigation in a Text/HTML module)

Thanks,
Ken
 
New Post
1/11/2009 10:22 PM
 

I have the same problem.

I need to set a unique id and/or class value on the body tag or create around 60 different skins (1 for each US state + others), I don't think the later is a very user friendly way to hand over to the client.

For example on the about page I need <body id ="about" class="subpage"> or <body class="about subpage"> and so on. I can't do this by url/tabid because I have no way of knowing what the tabid for pages that the client is going to create will be.

Thanks.

 
New Post
1/12/2009 7:15 AM
 

This is possible by adding some VB code to your ASCX skin.

Dim objTab As DotNetNuke.Entities.Tabs.TabInfo = CType(PortalSettings.ActiveTab.BreadCrumbs(0), DotNetNuke.Entities.Tabs.TabInfo)

will give you a TabInfo object from the breadcrumb (containing info for the page on level 0)

objTab.TabName will return the name of the Page on level 0.

 

if you wrap this in a function and return the page name:

<script runat="server">

    function RootPageName () as string

        Dim objTab As DotNetNuke.Entities.Tabs.TabInfo = CType(PortalSettings.ActiveTab.BreadCrumbs(0), DotNetNuke.Entities.Tabs.TabInfo)

        Return objTab.TabName

    end function

</script>

 

Now wrap your skin in a div:

<div class="<%=RootPageName%>">

    "your skin"

</div>

 

<%=RootPageName%> will be replaced dynamically by the name of the breadcrumb page on level 0

I did not test the code, sorry for any typos, but you should get the idea.

 

 
New Post
1/14/2009 11:57 AM
 

That's an excellent solution...good work Timo.


Ben Ahlquist
IDEaS Computers
http://www.ideascomputers.com
----------------------
Quality Forum Posts & Replies since 1996.

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...body id tagbody id tag


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