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, ...Highlight Current Page in dnnTREEVIEW???Highlight Current Page in dnnTREEVIEW???
Previous
 
Next
New Post
5/15/2009 1:03 AM
 

I have searched but did not see a way to do this. I'd like to apply a style (darker background, perhaps) to the page that is currently open.  Say that module 36 is currently open then the dnnTREEVIEW nav bar is a div...

<div id="dnn_dnnTREEVIEW_ctldnnTREEVIEWctr36">

I've been toying with perhaps writing server-side ASP that will grab the module number out of the address and dynamically write some style.

<style>

div#dnn_dnnTREEVIEW_ctldnnTREEVIEWctr<%=currentTab%>{

background-color:#E0E0E0;

}

</style>

 

This seems like a bit of a hack, so I thought I would see what others have done.  thanks in advance for looking.

 

Dan

 
New Post
5/22/2009 1:23 PM
 

Since nobody responded I take this to mean I'm the first to do this.  Let me show you what/how I did.  Added the following to the Default.aspx file.

<style>div#dnn_dnnTREEVIEW_ctldnnTREEVIEWctr<%=tabid%>{background-color:#D6DEEF}</style>
 

I had to add this line right above the <head> tag.  I tried to put in the <head> tag and it failed.  Not sure why.

Then I added a new property to Default.aspx.vb

        Protected _tabid As String = ""
        Protected Property tabid() As String
            Get
                Return _tabid
            End Get
            Set(ByVal value As String)
                _tabid = value
            End Set
        End Property

 

Then I set the property in Page_Load.  The line in green is new...

        Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Dim Scrolltop As HtmlControls.HtmlInputHidden = CType(Page.FindControl("ScrollTop"), HtmlControls.HtmlInputHidden)
            If Scrolltop.Value <> "" Then
                DotNetNuke.UI.Utilities.DNNClientAPI.AddBodyOnloadEventHandler(Page, "__dnn_setScrollTop();")
                Scrolltop.Value = Scrolltop.Value
            End If
     _tabid = PortalSettings.ActiveTab.TabID
        End Sub
 

That's it.  Works great!  Highlights the current tab in my nav bar.

 

 

 

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Highlight Current Page in dnnTREEVIEW???Highlight Current Page in dnnTREEVIEW???


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