Child Website Pages

Jul 28, 2010 at 5:59 PM

Is it possible to create sub-navigation links, or to associate the QuickLinks on the right with a specific page header?

For example, I might want to create an About Us link (top navigation) with sublinks to child pages for Contact Information, Driving Directions, and Company History.

 

Jul 28, 2010 at 6:10 PM

There are many ways of accomplishing this, depending on the behavior you want.  Just remember - this is a standard ASP.NET website, including integration with the site map provider.  All the practices you would use in ASP.NET can be used with this portal. 

Check out the master page, and specifically the CrmSiteMapChildView control - it will give you a list of child pages.  This could easily be moved from the ContentBottom content section to Sidebar. Everything is templatable and you have access to all the data in code-behind as well.

Shan McArthur
www.shanmcarthur.net

Nov 27, 2010 at 12:41 PM

I need to use the CrmSiteMapChildView control to show all of the child pages of the parent page, ie: all sibling pages, but I keep getting empty results.

Could you please show a quick example of that or guide me to documentation on the use of StartingNodeURL/StartFromCurrentNode for CrmSiteMapChildView Shan?

thanks

Nov 29, 2010 at 6:34 PM

The way to do it with a SiteMapDataSource would be to use <asp:SiteMapDataSource StartFromCurrentNode="true" StartingNodeOffset="-1" ... />, but CrmSiteMapChildView doesn’t support a similar StartingNodeOffset.

The only way to do this with CrmSiteMapChildView would be to set StaringNodeUrl to the URL of the parent of the current node, probably in code-behind. Assuming your CrmSiteMapChildView has an ID of "ChildView", you could do:

ChildView.StartingNodeUrl = System.SiteMap.CurrentNode.ParentNode.Url;

(Possibly with some null checks on CurrentNode and ParentNode, depending on your scenario.)

Dec 2, 2010 at 12:01 PM

Great suggestion! Thank you.

Solved my problem, but it is actually: System.Web.SiteMap.CurrentNode.ParentNode.Url

 

My solution worked like this: Master page Control not shown for Top level (Home), show children (no override) for pages parented by home page, and show sibling pages for anything deeper than that. 

           /* Conditional formating for Secondary Nav to show siblings */

           if (Children != null && System.Web.SiteMap.CurrentNode.ParentNode != null) // make sure Control exists and Page has a parent

           {

               string parentURL = System.Web.SiteMap.CurrentNode.ParentNode.Url;

               if (parentURL != "/")  // if parent not top level (Home)

               {

                   // Show siblings - Parent page is not root, this is 3rd level or lower

                   Children.StartingNodeUrl = "/" + parentURL;

                  Children.StartFromCurrentNode = false;

                }

 

Stephen Noe

www.bizitpro.com

Oct 10, 2013 at 9:18 AM
I am facing the same problem with primary navigation to set the drop down menu. I am successful to display to drop down to 2 level. But could you help me to how I can code to display to 3 level.

In code behind, in which function I need to code and what is children?
Please reply me