Try Now
More in this section

Forums / Developing with Sitefinity / Trouble with using the SiteMap

Trouble with using the SiteMap

3 posts, 0 answered
  1. Brent
    Brent avatar
    4 posts
    24 Oct 2007
    02 Feb 2009
    Link to this post
    I am trying to create a family of controls that generate different forms based on the starting node that is not the root, nor the current node.

    It came down to basically being unable to ascertain the Guid of a page by any means that I can use. If I use a repeater, I can iterate through the Guids with a "StartingNodeUrl" but trying to do so programmatically escapes me as it seems that "CurrentNode" and "RootNode" are my only options for starting points.

    Gabe's WebEditor completely fits the bill in this regard however, it crashes in our installation (3.2) with:

    A required control was not found in the template for "Goondocks.Admin.WebEditors.PageIdWebEditor+SiteMapContainer". The control must be assignable form type "Telerik.Web.UI.RadTreeView" and must have ID "".

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Web.HttpException: A required control was not found in the template for "Goondocks.Admin.WebEditors.PageIdWebEditor+SiteMapContainer". The control must be assignable form type "Telerik.Web.UI.RadTreeView" and must have ID "".

    Source Error:

    Line 204:                {
    Line 205:                    if (this.tree == null)
    Line 206: this.tree = base.FindRequiredControl<RadTreeView>();Line 207:                    return this.tree;
    Line 208:                }

    In addition to using this Webeditor which would be perfect for some of the uc's I am trying to build, I would also like to find a page ID by any piece of information that I have, URL, pagename. The CmsManager seems to provide every function except this.

    Secondly, the "Description" that comes from the SiteMap, where is that coming from. It does not seem to be coming from the "Description" listed on the page. While it is never null, it is always blank.

    Some help would be appreciated. Using Gabe's resources and other posts on this forum, I have got very very close, but using the Repeater does not quite give me enough control (e.g. control how many items get listed).

    To see the page I am talking about if that provides any illumination it is at http://www.able.audiomidi.com/content.aspx, and the first dynamic control there is "Reviews" which is just using a repeater, which I cannot get to stop list "All" the subcontents. Note that I am just getting started with C# so its possible that there are basic concepts I may be missing.

    Much thanks.
  2. Mike
    Mike avatar
    208 posts
    10 Dec 2007
    02 Feb 2009
    Link to this post
    Hi Brent,

    It seems to me that you'd be better off using the RadTabstrip control to list these links (unless you're trying to do paging or something).  There are a couple of additional properties that are useful to control what is displayed:

    HideLevel - You might use this to hide the first level, if you want only the children, for example.

    HierarchDepth - This controls how deep into your site tree the control looks.  You can get nested unordered lists, which are relatively easy to render any way you choose.

    So you might use the StartingNodeUrl to specify the top of your reviews hierarchy.  You can set the HideLevel and HierarchyDepth to hide the level your starting node is on, and control how many sub-levels are displayed.

    If you want even greater control over what's in the tabs, I'd start with the SiteTabStrip control, and modify the FillTabs method to achieve what you want.

    Mike Sharp
  3. Brent
    Brent avatar
    4 posts
    24 Oct 2007
    02 Feb 2009
    Link to this post
    Hi Mike,

    Thanks for the response.

    I don't want to use any of the RadControls because I want to have very complete control over the markup, and I want to do things can't do. Plus I would generally like to be able to understand how to derive my own custom navigational controls (which will sometimes look like complete pages) because it comes up time and time again.

    Gabe's control "Links" is basically what I want to do except I want even more control (for example, I will be sorting and grouping links by letter and category), but again it relies on having the Guid of the page.
Register for webinar
3 posts, 0 answered