MOSS and RadTabStrip for navigation

18 posts, 1 answers
  1. Chris Duden
    Chris Duden avatar
    12 posts
    Member since:
    May 2008

    Posted 12 Mar 2009 Link to this post

    Can someone explain to me how to get this structure:

    toplevel
    -sublevel 1 site 1
    -sublevel 1 site 2
    --sublevel 2 site 1

    to display like this using the radtabstrip:

    toplevel | sublevel 1 site 1 | sublevel 1 site 2
                                                  sublevel 2 site 1

    I followed the instructions for getting all this to work binding to the SiteMapDataSource.   It displays but it always shows up this way:

    toplevel 
    sublevel 1 site 1 | sublevel 1 site 2
                                                  sublevel 2 site 1

    Consequently I always have one and only one tab (toplevel)...not very useful.  I could care less about the toplevel showing up at all.  I want the subsites to be my top tabs.  I tried setting the ShowStartingNode="false" and even played with the offset on the datasource but it doesn't seem to change a thing.

  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 13 Mar 2009 Link to this post

    Hello Chris Duden,

    I guess you want to achieve something like this. If yes here is the markup which we have used to create the aforementioned MOSS page:

                <telerik:RadTabStrip runat="server" ID="RadTabStrip1" DataSourceID="siteMapDataSource1" Skin="Web20"/>
                      <PublishingNavigation:PortalSiteMapDataSource ID="siteMapDataSource1" Runat="server"
                                                SiteMapProvider="CombinedNavSiteMapProvider" EnableViewState="true"
                                                StartFromCurrentNode="true" StartingNodeOffset="0" ShowStartingNode="false"
                                                TreatStartingNodeAsCurrent="true" TrimNonCurrentTypes="Heading"/>

    I hope this helps,
    Albert
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Chris Duden
    Chris Duden avatar
    12 posts
    Member since:
    May 2008

    Posted 13 Mar 2009 Link to this post

    That did the trick.  Follow up question.  It works for a publishing portal (master page based upon something like blueband.master) but what about a collaboration publishing portal like default.master.  That masterpage has the following datasource:

    <asp:SiteMapDataSource
         ShowStartingNode="False"
         SiteMapProvider="SPNavigationProvider"
         id="topSiteMap"
         runat="server"
         StartingNodeUrl="sid:1002"/>

    instead of

    <PublishingNavigation:PortalSiteMapDataSource .../>

    the asp:sitemapdatasource doesn't have the same properties and it doesn't seem to work (it ignores any properties set on it).

    Thanks for your help.



  4. Answer
    Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 16 Mar 2009 Link to this post

    Hi Chris Duden,

    The SPNavigationProvider seems to always returns the top ("Home") item. The built-in MOSS menu is aware of this behavior and renders the "Home" item as if it were child item. Unfortunately RadTabStrip cannot handle this case and renders the Home item as root item with child tabs. It seems however that you can use a PortalSiteMapDataSource in this case and achieve the desired results. I've tested this by adding the PortalSiteMapDataSource control in default.master.

    Greetings,
    Albert
    the Telerik team


    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. Chris Duden
    Chris Duden avatar
    12 posts
    Member since:
    May 2008

    Posted 16 Mar 2009 Link to this post

    Thanks Albert, that does what I need.

    CMD
  6. Paul
    Paul avatar
    35 posts
    Member since:
    Jul 2008

    Posted 18 Mar 2009 Link to this post

    Hi,

    Where abouts in the default.master do you put the 'PublishingNavigation:PortalSiteMapDataSource' tag as if i put it before the radtabstip I get the following error:
     
    Unknown server tag 'PublishingNavigation:PortalSiteMapDataSource'.

    I have only started putting the controls into sharepoint and think they add so much to the UI

    Many Thanks
  7. Chris Duden
    Chris Duden avatar
    12 posts
    Member since:
    May 2008

    Posted 18 Mar 2009 Link to this post

    The entire masterpage is at the bottom of this post:

    http://www.telerik.com/community/forums/aspnet-ajax/splitter/moss-and-radsplitter-invalid-json.aspx

    You need to add a registration at the top of the page.

    CMD
  8. Paul
    Paul avatar
    35 posts
    Member since:
    Jul 2008

    Posted 18 Mar 2009 Link to this post

    That worked a treat.

    While im on the subject is there a way of persisting the expanded tab after postback for example

    Parent 1       Parent 2
         |
         |
    Child 1      Child 2

    if i select child 2 (decendant of parent 1) when the new pages loads is there a way of keeping the parent 1 tab expanded (highlighting what i just clicked).  Do i need to write some funky javascript to do this?

    Thanks

  9. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 19 Mar 2009 Link to this post

    Hi Paul,

    RadTabStrip should do this by itself if bound to a sitemap provider which correctly implements the CurrentNode property. In this example RadTabStrip is bound to the PortalSiteMapDataSource controls and correctly retains the current tab.

    Best wishes,
    Albert
    the Telerik team


    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  10. Paul
    Paul avatar
    35 posts
    Member since:
    Jul 2008

    Posted 19 Mar 2009 Link to this post

    This is what I thought but i hve the following data source and it is not binding to the current

                       <PublishingNavigation:PortalSiteMapDataSource ID="siteMapDataSource1" Runat="server"
                                                SiteMapProvider="CombinedNavSiteMapProvider" EnableViewState="true"
                                                StartFromCurrentNode="true"  StartingNodeOffset="0" ShowStartingNode="false"
                                                TrimNonCurrentTypes="Heading" />
  11. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 19 Mar 2009 Link to this post

    Hello Paul,

    This is the declaration of the tabstrip and the datasource which we have used in our example:

    <telerik:RadTabStrip runat="server" ID="RadTabStrip1" DataSourceID="siteMapDataSource1"   Skin="Web20"/>

    <PublishingNavigation:PortalSiteMapDataSource ID="siteMapDataSource1" Runat="server"
                            SiteMapProvider="CombinedNavSiteMapProvider" EnableViewState="true"
                            StartFromCurrentNode="true" StartingNodeOffset="0" ShowStartingNode="false"
                            TreatStartingNodeAsCurrent="true" TrimNonCurrentTypes="Heading"/>


    Regards,
    Albert
    the Telerik team


    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  12. Chris Duden
    Chris Duden avatar
    12 posts
    Member since:
    May 2008

    Posted 19 Mar 2009 Link to this post

    Albert is obviously more qualified to help you with this. I will just agree that it does behave for me as Albert describes.  One thing I might suggest is to play around with the MOSS settings for the site navigation behavior, it affects how everthing works.

    Nobody has followed up on the other issue (link is in this thread), I'm not sure what that means.  Should I have posted it in a different area?

    Goodluck Paul and thanks for your help Albert.
  13. Paul
    Paul avatar
    35 posts
    Member since:
    Jul 2008

    Posted 19 Mar 2009 Link to this post

    Yes I should have started another thread I didnt mean to hyjack just got a bit carried away.

    The odd thing is it does persist the selected tab if that tab links to a site it doesnt if the table links to a document library to get .aspx page for example a webpart page
  14. Chris Duden
    Chris Duden avatar
    12 posts
    Member since:
    May 2008

    Posted 19 Mar 2009 Link to this post

    I just tested it.  You are absolutely correct.  If you create a link to any page within the site using the MOSS tool for managing the navigation, those links do not work correctly.

    I'm not really sure you hijacked the thread.  Your issue is related:  how to get the tabstrip to work correctly with the MOSS navigation datasources.

    Goodluck and I will continue reading Albert's responses since now that I know about this issue it is an issue for me too.  I just hadn't built out the navigation for the site yet.  In another week or so I would have been posting your question.

    CMD
  15. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 19 Mar 2009 Link to this post

    Hi,

    RadTabStrip relies on the underlying sitemap provider to determine the current page via the CurrentNode property. If the SiteMap provider does not properly update the current node for those particular pages you can implement programatic highlighting as described in this example. The problem here is that server-code is disabled by default for sharepoint master pages. Fortunately there is a workaround explained in this msdn help article. In a word you need the following code (or something similar) to find the tab which corresponds to the current url and select it:

     RadTabStrip1.DataBind();
     RadTab tab = RadTabStrip1.FindTabByUrl(Request.Url.PathAndQuery);
      if (tab != null)
      {
         tab.SelectParents();
         tab.PageView.Selected = true;
      }

    That code should be executed after the tabstrip has been databound. You can force that by calling its DataBind method first.

    I hope this helps,
    Albert
    the Telerik team


    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  16. Chris Duden
    Chris Duden avatar
    12 posts
    Member since:
    May 2008

    Posted 19 Mar 2009 Link to this post

    Intersting.   I have a deadline on another piece for this week but if you get this working Paul I would appreciate it if you posted your solution.

    CMD
  17. Paul
    Paul avatar
    35 posts
    Member since:
    Jul 2008

    Posted 19 Mar 2009 Link to this post

    I will do

    I just tried enabling code on my master page and it caused a few compolation errors so I will need to resolve these.  I will have a go tomorrow and if it doesnt work I will not be able to have another look till the following friday.  But want to get this working so will post my solution
  18. Paul
    Paul avatar
    35 posts
    Member since:
    Jul 2008

    Posted 25 Mar 2009 Link to this post

    I got it working perfectly I did the following

    added this code to the master page

    <script runat="server">  
     
     
     
        protected void Page_Load(object sender, EventArgs e)     
        {     
            RadTabStrip1.DataBind();  
            RadTab tab = RadTabStrip1.FindTabByUrl(Request.Url.PathAndQuery);     
            if (tab != null)     
            {     
                tab.Selected = true;     
                tab.SelectParents();     
            }     
        }     
          
     
    </script> 
     

    and the following to the web.config to allow the code to run

          <PageParserPaths> 
             <PageParserPath VirtualPath="/BI/_catalogs/masterpage/*" CompilationMode="Always" AllowServerSideScript="true" />  
    Thanks for your help

Back to Top