Page view counter

SOLPartMenu - How to prevent dropdown for currently active menu item?

Last post 04-06-2005 10:41 AM by masom. 19 replies.

Sort Posts:

  • SOLPartMenu - How to prevent dropdown for currently active menu item?

    03-21-2005, 6:10 PM
    • Loading...
    • svoeller99
    • Joined on 08-12-2004, 9:32 AM
    • Portland, OR
    • Posts 73
    • Points 365
    I'm skinning SolPartMenu and I want to disable the dropdown menu when the currently-selected menu item is active. Does anyone know how to do this?

    Thanks,

    Sean
    Sean Voeller
    Rapidigm, Inc.
  • Re: SOLPartMenu - How to prevent dropdown for currently active menu item?

    03-21-2005, 7:03 PM
    • Loading...
    • svoeller99
    • Joined on 08-12-2004, 9:32 AM
    • Portland, OR
    • Posts 73
    • Points 365
    update:

    I was able to pull off the desired effect, but I had to modify the code base to do it. To be more specific, I'm looking for a solution that doesn't require a modification of the DNN base code.

    Sean
    Sean Voeller
    Rapidigm, Inc.
  • Re: SOLPartMenu - How to prevent dropdown for currently active menu item?

    03-21-2005, 8:32 PM
    • Loading...
    • JWhite
    • Joined on 06-26-2002, 10:30 AM
    • New York
    • Posts 2,616
    • Points 13,100
    It's an all or none proposition right now. (i.e. They all drop down or none of them do.) Can you explain your use case as to what ill effects letting the all the menu items drop down causes. If there is a valid use case and not a "one off" configuration, then we may consider adding an enhancement to the core to allow this in the future.
  • Re: SOLPartMenu - How to prevent dropdown for currently active menu item?

    03-21-2005, 9:00 PM
    • Loading...
    • Sailu_tp
    • Joined on 01-20-2004, 6:19 PM
    • Posts 110
    • Points 536
    Jeremy
    If the application needs to be section 508 compliant then i don't think drop down menus will work on the hor menu. They need to be tabbed horizontally/vertically. This is one of the use cases i can think of for an example.
    Thanks,
    Sailu.
  • Re: SOLPartMenu - How to prevent dropdown for currently active menu item?

    03-21-2005, 9:27 PM
    • Loading...
    • JWhite
    • Joined on 06-26-2002, 10:30 AM
    • New York
    • Posts 2,616
    • Points 13,100
    In that case just use the RootOnly attribute and set it to true. We've already allowed for that scenario.
  • Re: SOLPartMenu - How to prevent dropdown for currently active menu item?

    03-21-2005, 9:48 PM
    • Loading...
    • Sailu_tp
    • Joined on 01-20-2004, 6:19 PM
    • Posts 110
    • Points 536
    Jeremy
    Sorry for the stupid question, but where do i set it?
    Thanks,
    Sailu.
  • Re: SOLPartMenu - How to prevent dropdown for currently active menu item?

    03-21-2005, 10:06 PM
    • Loading...
    • JWhite
    • Joined on 06-26-2002, 10:30 AM
    • New York
    • Posts 2,616
    • Points 13,100
    depends on the type of skin you have,

    HTML skin: change it in the .xml file as part of the the SolPartMenu token settings

    <Name>RootOnly</Name>
    <Value>True</Value>


    if it's in an .ascx skin: change the control attributes

    <dnn:SOLPARTMENU ... ... ... RootOnly="True" />

  • Re: SOLPartMenu - How to prevent dropdown for currently active menu item?

    03-21-2005, 10:12 PM
    • Loading...
    • Sailu_tp
    • Joined on 01-20-2004, 6:19 PM
    • Posts 110
    • Points 536
    Thanks Jeremy, i will look at it. Just wanted to ask 1 more quick question i have not received any response from any one for this so i am asking you:
    I need to have 1 hor menu with each of its children being vert tabs,
    you have already answered the first part which is by setting the Rootonly attr,
    but could you give me any suggestions how i can accomplish the vert tabs for each hor tab.
    Please post if so. It will be really appreciated.
    Thanks,
    Sailu.
  • Re: SOLPartMenu - How to prevent dropdown for currently active menu item?

    03-21-2005, 10:22 PM
    • Loading...
    • JWhite
    • Joined on 06-26-2002, 10:30 AM
    • New York
    • Posts 2,616
    • Points 13,100
    for the second menu skin object use the Level attribute and set it to Child or Same depending on what you want.
  • Re: SOLPartMenu - How to prevent dropdown for currently active menu item?

    03-22-2005, 3:39 PM
    • Loading...
    • svoeller99
    • Joined on 08-12-2004, 9:32 AM
    • Portland, OR
    • Posts 73
    • Points 365
    Jeremy,

    Thanks for your reply. To be more specific as to my use case....

    I'm using the Links control, which I locate directly under the SolPartMenu, in order to display child pages of the currently selected tab. I wanted to turn off the dropdown on the current tab, because having the child tabs displayed with Links.ascx and also having a dropdown with essentially the same content seems redundant to me. I'm going for a tab/subtab feel for my skin. Maybe, in the future, there could be a new setting for skin.xml - maybe, 'dropdownactivetab', or something...

    My modification to the code was this; I added the following line at the very beginning of the try block located at line 1072 of SolPartMenu.ascx.vb --> Page_Load()....


    If objTab.ParentId = PortalSettings.ActiveTab.TabID Then Throw New Exception("Current tab") 'added to disable dropdown for selected tab


    I know it's a bit clunky - throwing an exception here - but it acheives my intended result in a one-liner.

    Sean
    Sean Voeller
    Rapidigm, Inc.
  • Re: SOLPartMenu - How to prevent dropdown for currently active menu item?

    03-22-2005, 3:45 PM
    • Loading...
    • svoeller99
    • Joined on 08-12-2004, 9:32 AM
    • Portland, OR
    • Posts 73
    • Points 365
    Another thing that I wanted to circumvent was the effect that this block of code has, located at the end of Links.ascx.vb --> Page_Load()


    If strLinks = "" Then
    strLinks = BuildLinks("", Alignment, strSeparator, strCssClass)
    End If


    If you set level to "child" and navigate to a tab that has no children, it reverts to displaying links for the tabs on the same level. I worked around it by modifying the code in Links.BuildLinks, as follows:


    Select Case Level
    Case "Same", ""
    If objTab.ParentId = PortalSettings.ActiveTab.ParentId Then
    strLinks += strLoop & AddLink(objTab.TabName, objTab.FullUrl, strCssClass)
    End If


    ...was changed to...


    Select Case Level
    Case "Same", ""
    If Me.Level <> "Child" Then 'if we weren't originally in child mode
    If objTab.ParentId = PortalSettings.ActiveTab.ParentId Then
    strLinks += strLoop & AddLink(objTab.TabName, objTab.FullUrl, strCssClass)
    End If
    End If


    Sean
    Sean Voeller
    Rapidigm, Inc.
  • Re: SOLPartMenu - How to prevent dropdown for currently active menu item?

    04-05-2005, 1:43 PM
    • Loading...
    • ylvah
    • Joined on 02-28-2005, 11:29 PM
    • Sundsvall
    • Posts 25
    • Points 125

    Hello!

    That was what I wanted to do - then I could have an horisontal menu with vertical sub-menu. I works out fine except that if I do this there is no way to reach the admin and host menu items? Am I being stupid now??

    regards Ylva

  • Sv: Re: SOLPartMenu - How to prevent dropdown for currently active menu item?

    04-05-2005, 2:00 PM
    • Loading...
    • jan_olsmar
    • Joined on 02-06-2004, 12:10 PM
    • Sweden
    • Posts 886
    • Points 4,430

    NO Ylva you are not stupid :)

    There is a way around the issue but you have to manually change in the database.

    If you change the value for the host and admin tab to bee visible. Dont remember for the moment what field it is.

     

    Jan O
    www.olsmar.com
  • Sv: Re: SOLPartMenu - How to prevent dropdown for currently active menu item?

    04-05-2005, 2:10 PM
    • Loading...
    • jan_olsmar
    • Joined on 02-06-2004, 12:10 PM
    • Sweden
    • Posts 886
    • Points 4,430
    Its the disablelink in tabs table change fom 1 to 0
    Jan O
    www.olsmar.com
  • Re: Sv: Re: SOLPartMenu - How to prevent dropdown for currently active menu item?

    04-05-2005, 2:22 PM
    • Loading...
    • ylvah
    • Joined on 02-28-2005, 11:29 PM
    • Sundsvall
    • Posts 25
    • Points 125

    Thank you! But when I look in the table these tabs already has the value 1 on disablelink.

    But I can have this settings if I choose one skin for the portal and no skin for admin. Then I can choose site in the menu in the right upper corner and then I get my admin and host menu items in the default blue skin. Rather strange ;)

    regards Ylva

Page 1 of 2 (20 items) 1 2 Next >