+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Nav - all pages under current PLUS parent?

Nav - all pages under current PLUS parent?

18 posts, 1 answered
  1. Nik
    Nik avatar
    10 posts
    Registered:
    06 May 2013
    03 Oct 2013
    Link to this post
    I have a vertical Left-hand Nav(LHN) that is set to "All pages under particular page". I need it to show the primary parent page in that list as well.
    ie: Currently shows:
    Subpage1
       SubsubpageA
    Subpage2
    Subpage3

    Need it to show:
    ParentPage
       Subpage1
         SubsubpageA
       Subpage2
       Subpage3

    Can this be done very easily?
  2. Ivan D. Dimitrov
    Ivan D. Dimitrov avatar
    310 posts
    Registered:
    26 Mar 2015
    08 Oct 2013
    Link to this post
    Hi Nikolei,

     You can achieve this by selecting Top-level pages (and their child-pages if template allows) option of the Sitefinity navigation in its designer.

    Regards,
    Ivan D. Dimitrov
    Telerik
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Nik
    Nik avatar
    10 posts
    Registered:
    06 May 2013
    08 Oct 2013 in reply to Ivan D. Dimitrov
    Link to this post
    That would show all top-level items though. I only want to show the single top level parent that groups whatever page you're on.
  4. Markus
    Markus avatar
    2763 posts
    Registered:
    25 Nov 2005
    08 Oct 2013 in reply to Nik
    Link to this post
    Dear Nik
     
    I am not sure if I got your idea right.

    I wanted once to just display the top level page as kind of breadcrumb stlye. I  used this .ascx. Maybe this is a starting point

    .ascx
    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SubNaviTitle.ascx.cs" Inherits="SitefinityWebApp.UserControls.SubNaviTitle" %>
     
    <asp:Label ID="Label1" runat="server" Text="Home" CssClass="SubNaviTitle"></asp:Label>


    .ascx.cs

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
     
    using Telerik.Sitefinity.Web;
    using Telerik.Sitefinity.Modules.Pages;
     
     
     
    namespace SitefinityWebApp.UserControls
    {
        public partial class SubNaviTitle : System.Web.UI.UserControl
        {
            protected void Page_Load(object sender, EventArgs e)
            {
                var actualNode = SiteMapBase.GetActualCurrentNode();
                if(actualNode != null){
                while (actualNode.ParentNode != null && actualNode.ParentNode.Title != "Pages")
                {
                    actualNode = actualNode.ParentNode as PageSiteNode;
     
                }
                Label1.Text = actualNode.Title;
                }
                else
                {
                    Label1.Text = " ";
                }
     
            }
        }
    }


    Usually my scenario is as follows

    Top Navigation with main menu items

    Left side subnavi with all navigation items under the current selected top navigation item

    The left side a the moment is still done by me with the panelbar (rad control enabled in admin) and datasource solution as described here: http://www.sitefinity.com/developer-network/forums/general-discussions-/menu-question

    I never understood what the all under a current page option is good unless you make a ton of templates for each main navigation menu.

    Markus

    PS: as seen here: http://grandag.ch.mserver3.arvixevps.com/mietfahrzeuge/subaru-impreza-sti
  5. Ivan D. Dimitrov
    Ivan D. Dimitrov avatar
    310 posts
    Registered:
    26 Mar 2015
    11 Oct 2013
    Link to this post
    Hello guys,

     Praise to Markus for the informative resource. I think I achieved the result using the Built in Navigation without Modifying it. I created the page node Hierarchy as described ( view images attached.) then in the navigation I selected "Custom selection of pages", selected the one I want and gave it a template - Horizontal with drop down menus. It produced the result in the second image.

    Regards,
    Ivan D. Dimitrov
    Telerik
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Markus
    Markus avatar
    2763 posts
    Registered:
    25 Nov 2005
    11 Oct 2013 in reply to Ivan D. Dimitrov
    Link to this post
    Dear Ivan 

    Can you make an example with two navigations

    Main Naviation would have Test, 111, 211 shown (horizontal only top level
    Secondary navigation - when you click on 211 it would show 222, 121, 122 

    As per your screenshots 

    And when you click on 212 it still shows 211, 222 (open wiht 222) 121, 122

    This is my most often uses scenario splitting the navigation in main and secondary as seen in these examples.  

    Preferable out of the box.

    http://www.golf-winterberg.ch/golfpark
    http://www.baumgartner-gartenbau.ch/bioteiche

    http://grandag.ch.mserver3.arvixevps.com/mietfahrzeuge/wohnmobil/
    http://sternen-rafz.ch.mserver4.arvixevps.com/restaurant

    Markus





  7. Ivan D. Dimitrov
    Ivan D. Dimitrov avatar
    310 posts
    Registered:
    26 Mar 2015
    16 Oct 2013
    Link to this post
    Hi Markus,

     Following your directions I was able to achieve the requested result with only one Nav widget. Please see the screenshots attached. I find this a good way to get to the goal with the out of the box widget.

    Regards,
    Ivan D. Dimitrov
    Telerik
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  8. Markus
    Markus avatar
    2763 posts
    Registered:
    25 Nov 2005
    16 Oct 2013 in reply to Ivan D. Dimitrov
    Link to this post
    Thanks Ivan

    I realy don't get it. Handpicking the pages means (unless I am wrong)

    a) you need to have a template for each main menu item
    b) if you add a page you need to go back and add that page to custom selection

    If a) or b) is true I rather stick to my radControl Sitemap StartingNode offset method.

    Markus

  9. Ivan D. Dimitrov
    Ivan D. Dimitrov avatar
    310 posts
    Registered:
    26 Mar 2015
    17 Oct 2013
    Link to this post
    Hi Markus,

     You are correct - B is true. As you can add the navigation I have demonstrated to a template, you do need to add every newly created page to it if you want it to show. So far this is the most functionality our out of the box Navigation presents. 

    Regards,
    Ivan D. Dimitrov
    Telerik
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  10. Nik
    Nik avatar
    10 posts
    Registered:
    06 May 2013
    18 Oct 2013
    Link to this post
    Incase it's of any help to anyone, I came up with my own solution. By adding the following JS, it injects the title of the primary parent page ontop of the 2ndary navigation.

    // Inject primary parent name in LHN
        if (jQuery(".sfSel").html() != undefined) {
            activeNavParent = jQuery(".sfSel").html().replace('<span class="k-icon k-i-arrow-s"></span>', '');
            activeNavParentUrl = jQuery(".sfSel").attr("href");
     
            lhnMenu = jQuery(".leftnav ul.sfNavTreeview");
            if (lhnMenu != undefined) {
                lhnMenuContent = lhnMenu.html();
                lhnMenuContent = '<li class="k-item k-first lhnparent"><a href="' + activeNavParentUrl + '" class="lhnparentlink">' + activeNavParent + '</a><ul>' + lhnMenuContent + '</ul></li>';
                lhnMenu.html(lhnMenuContent);
                //lhnMenu.prepend('<li class="k-item k-first"><a href="' + activeNavParentUrl + '">' + activeNavParent + '</a></li><ul>');
                //lhnMenu.append('</ul>');
            }
        }

    Using the page structure you guys created, if the user was on 222, or 212, this script would add 211 above the normal listing of 222, 212, 121 and 122. I still have to drag the LHN navigation widget to each page and select show all pages under page X, but it displays what I need. It would be nice to have some more built-in options for secondary navigation.
    Answered
  11. Markus
    Markus avatar
    2763 posts
    Registered:
    25 Nov 2005
    18 Oct 2013 in reply to Nik
    Link to this post
    Dear Nik

    Thanks' for sharing.

    Yes I would love to have the option to choose - All pages under current top page (whithout top page) as an default option.

    Or at least let us be able to set an datasource.

    Markus
  12. Sebastian
    Sebastian avatar
    5 posts
    Registered:
    23 Jan 2014
    11 Nov 2014
    Link to this post

    I am having the same problem with Sitefinity trying to build a menu that is common in most CMS.

    Using JS is not an option. Creating a custom widget for a standard behavior seems too much effort. Inserting the menu widget to a page every time I create a new page isn't an option either. It takes just way to much time and prone to failure.

     Is there no way to use the Sitefinity standard features to have a left menu showing "childs from the current top level page"?

  13. Brett Whittington
    Brett Whittington avatar
    33 posts
    Registered:
    12 Jan 2012
    11 Nov 2014 in reply to Sebastian
    Link to this post
    Forgive me if you have already tried this or if this option was already described above.  I didn't read everything but have you tried the ShowParentPage on theadvanced options tabe of the navigation widget? (Attached Image)  Then you can create/change the widget template to included Parent Item template as shown on Documentation Link?
    <ParentItemTemplate>
        <li>
            <a id="A1" runat="server" href="javascript:void(0);"><%# Eval("Title") %></a>                                                
        </li>                   
    </ParentItemTemplate>
  14. Sebastian
    Sebastian avatar
    5 posts
    Registered:
    23 Jan 2014
    12 Nov 2014
    Link to this post

    I guess your sample is referring to include the parent item.

    But the issue is to show "All Childs of the Current Top-Parent".
    Without the need to insert the menu on every page we create and without using a custom widget.

    The attached fake screen capture shows how the left menu should look like.
    It shows all child menu pages (including their sub-pages) from the CURRENT TOP PARENT menu item.

    Is this doable with Sitefinity without a custom widget, Javascript, or adding the menu to any new page?

  15. Ivan D. Dimitrov
    Ivan D. Dimitrov avatar
    310 posts
    Registered:
    26 Mar 2015
    17 Nov 2014
    Link to this post
    Hi all,

    @Sebastian

    The scenario you require is available out of the box. Simply add a Navigation widget to the template your pages are using. On the navigation widget select the "All pages under currently opened page"  option. This will achieve the needed result. Here is a video demonstration for further reference.

    Regards,
    Ivan D. Dimitrov
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
  16. Ethan
    Ethan avatar
    1 posts
    Registered:
    29 Jul 2014
    11 Dec 2014 in reply to Sebastian
    Link to this post
    I am trying to figure out how to do this right now. I have a template for interior pages with a navigation widget on the side. Since there are quite a few top level pages I would really like to avoid having to create a separate template for each top level page. My situation is almost identical to the "menu-fake" image you posted. So selecting all pages under a particular page is not an option, because that would require a new template for every top level page in the nav. And selecting all top level pages, while dynamic, still shows all siblings of the current top level page. Have you, or anyone else here, found a way to do this without writing a custom widget?
  17. Ivan D. Dimitrov
    Ivan D. Dimitrov avatar
    310 posts
    Registered:
    26 Mar 2015
    16 Dec 2014
    Link to this post
    Hi all,

    @Ethan

    This scenario will require a custom navigation control as it basically combines the functionality of our "Top-level pages" and our "All pages under currently opened page"  navigation options. I can recommend you go through this blog post describing how to create a mega menu in Sitefinity. Additionally you can use our Pages API in order to bind the set of nodes you require along with any conditions on when they should display to a control of your chosing (I can recommend you use a RadPanelBar).

    Regards,
    Ivan D. Dimitrov
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
  18. Jason
    Jason avatar
    5 posts
    Registered:
    05 Feb 2014
    05 Mar 2015 in reply to Ivan D. Dimitrov
    Link to this post

    In the 3.7 versions we had the StartingNodeOffset property, which reduced custom dev and mutliple templates. Any plans to roll this out in future versions? 

    Related post:
    http://www.sitefinity.com/developer-network/forums/general-discussions-/startingnodeoffset-in-sitefinity-navigation

18 posts, 1 answered