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

Forums / Developing with Sitefinity / how to disable sitemap tool for certain pages?

how to disable sitemap tool for certain pages?

4 posts, 0 answered
  1. humayoo
    humayoo avatar
    89 posts
    Registered:
    25 Oct 2010
    10 Mar 2011
    Link to this post
    Hello,

    when you click pages->site map, then all pages icon selected by default and 

    'Select a page above and:' inactive by default.

    i want if i click on some specific page,'Select a page above and:' icon will be inactive. please see attachment for clarity.

    thanks
    Humayoo
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    10 Mar 2011
    Link to this post
    Hello humayoo,

    You should modify Sitefinity\Admin\ControlTemplates\Pages\SiteMapPanel.ascx. You should subscribe for
    ClientNodeClicked


    <script type="text/javascript">
     
        function ClientNodeClicked(sender, eventArgs) {
            var node = eventArgs.get_node();
             
        }
     
     
    </script>


    Then you can disable the div SiteMapTools with jQuery functions.

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. humayoo
    humayoo avatar
    89 posts
    Registered:
    25 Oct 2010
    10 Mar 2011
    Link to this post
    Hello,
     i did as you said, site map tool is hide and again show when page post back; onClientNodeClicked event post back is occurring.  this is my code

    function ClientNodeClicked(sender, eventArgs) {
        var node = eventArgs.get_node();
        var treeViewInstance = "<%=SiteNavigation.ClientID %>";
        var selectedNode = document.getElementById(treeViewInstance);
        //var selectedNode = eventArgs.NodeClicked;
        //alert(selectedNode.value);
        if (selectedNode.value == "41fd2b2f-dfd2-473a-9ca4-80269708280f") {
            //eventArgs.set_cancel(true);
            document.getElementById("smWrapper").style.display = "none";
     
        }
     
        return false;
         
    }
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    10 Mar 2011
    Link to this post
    Hi humayoo,

    You can persist the selection in a cookie and read it after the post back inside Page_Load. Then hide the SiteMapTools or make changes to the RadTreeView.

    All the best,
    Ivan Dimitrov
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Register for webinar
4 posts, 0 answered