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

Forums / Developing with Sitefinity / Sitemenu control

Sitemenu control

6 posts, 0 answered
  1. Daniel Svensson
    Daniel Svensson avatar
    12 posts
    Registered:
    31 Aug 2009
    04 Sep 2009
    Link to this post
    Hi,

    I have a page group with some pages that have anonymous access set to denied. Only persons with the right roles can access them.

    When you have logged in i want to display those pages in that sub-tree (page-group) of the sitemap that the user has rights to see.

    How do you render that sub-tree of pages belonging to the page group considering the roles?
    Can't seem to figure it out.

    I use sitefinity 3.7 with the shipped sitefinity sitemenu control.

    Daniel Svensson
  2. Joe
    Joe avatar
    138 posts
    Registered:
    24 Sep 2012
    04 Sep 2009
    Link to this post
    Hi Dan,

    Thanks for contacting us.

    Please set the starting node offset property to 1 for the SiteMenu. This will show you all of the pages right beneath the page group. If you had a page group nested beneath another page group and you wanted to show only those pages, set the starting node offset to 2. Sitefinity is using security trimming, so the user will only see pages he or she can access.

    Please let us know if you have any questions.

    All the best,
    Joe
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Daniel Svensson
    Daniel Svensson avatar
    12 posts
    Registered:
    31 Aug 2009
    06 Sep 2009
    Link to this post
    Hi,

    My sitemenu looks like this:

    All Pages -> Page "A" ( shown in sitemenu)
                        Page "B" ( not shown in sitemenu)
                        Page "Group" -> RoleXPage.aspx
                                               -> RoleYPage.aspx
                                               -> RoleZPage.aspx

    On every rolepage there is a treeview ctrl.

    Problem: Each user that has logged in is redirected to their partnerpage defined by their role. But since
    each user can belong to several roles i would also like to display on their partnerpage a treeview of actual partnerpages they can navigate to.

    So, if i have a user belonging to RoleX and RoleY then when that user is logged in then he should go to any of those pages [RoleXPage.aspx || RoleYPage.aspx], but also on that page show all pages he can navigate to from within the Page "Group".

    /Daniel
  4. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    07 Sep 2009
    Link to this post
    Hi Daniel Svensson,

    As Joe has described bellow you can easily set the desired navigation. You can either create a common template for partner pages, or just set each page one by one. I will use as an example a common page template. For the example I have prepared 1 Page Group ( ~/partners.ascx), 3 sub-pages (~/partners/partnera.ascx, ~/partners/partnerb.ascx, ~/partners/partnerc.ascx), 3 roles for each partner (RoleA, RoleB, RoleC), and one user that belongs to RoleA && RoleC.

    I will create a template, in which besides the top navigation, for displaying all navigable pages, I will use a Site Treeview control from Navigation as a sidebar navigation to display navigable partner pages. I will place the Site Treeview control in the template's side bar and configure it as Joe has described (see sitetreeview.png). And the result will be as in userinrolesaandc.png.

    If however you wish your tree view to display pages in the following manner:
    Parthers
     ---->Partner A
     ---->Partner B
     ---->Partner C

    Try using the configuration in sitetreeview2.png, and the desired result will be as in userinrolesaandc2.png.

    if you have more questions, please feel free to post in our forums or contact us by raising a support ticket.

    Regards,
    Radoslav Georgiev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. Daniel Svensson
    Daniel Svensson avatar
    12 posts
    Registered:
    31 Aug 2009
    08 Sep 2009
    Link to this post
    hi,

    I understand what you say but i canät seem to reproduce what you want.

    My sitemap:

    All Pages:
        Startpage ( navigation: true )
        Knowledgde ( navigation: true )
        Contact ( navigation: true )
        Our partners ( navigation: true )
        Blog ( navigation: true )
        Case ( navigation: true )
        Admin ( navigation: false )
        PartnerPages
            ProjectA ( navigation: false )
            ProjectB ( navigation: false )
            ProjectC ( navigation: false )
         ErrorPages
            Error404 ( navigation: false )
            Error403 ( navigation: false )
            CustomError ( navigation: false )

    Roles:
       Admin (access Admin.aspx)
       RoleA (access ProjectA)
       RoleB (access ProjectB)
       RoleC (access ProjectC)
     
    The rest of the pages are public to everyone.

    Using just one template, the My Organization. In the top of template i have a sitemenu and it renders correctly, those with navigation: true.

    But on all Project'X' pages i put a sitetree and when i set False,False,1 in the edit of that control at the top nothing shows. I have tried to set other numbers such as '8' and then Project'X' shows ? I'm not sure i understand how the logic for the startingnodeoffset works?

    So i explicitly wanted to show you how my sitemap looks like so i didn't forget to tell you anything important.

    /Daniel S
  6. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    08 Sep 2009
    Link to this post
    Hello Daniel Svensson,

    Thank you for providing the information for the organization of pages in your site map.

    Now I see what is the cause of the problem. You have set the partner pages not to be navigable. Since the navigation controls are dynamically bound to the site map pages set to be non navigable will not appear in any of the navigation controls. The best practice approach when you want to prevent users from seeing pages would be just to remove the view permission for their role. Then if you do not wish non authenticated users to see those pages you should use the Deny Anonymous property in the Page Properties tab.

    Before you set page permissions, please note that pages inherit permission rules from parent pages. If you wish child pages to use different sets of permissions you should Break Inheritance (see breakinheritance.png). So first you should set pages which you do not want to display to all users (such as partner pages) to navigable. Then if you wish anonymous users not to be able to see or navigate to those pages use Deny Anonymous property (see denyanonymous.png).

    One more note before I continue. Page groups have less properties - they do not have the deny anonymous property. So if you wish logged in users to see the Partner pages with available child pages in navigation you can set the page group to Normal Page. It will still be able to hold child pages.

    Now if you consider having roles different from RoleA, RoleB, and RoleC and users from those roles not to be able to see partner pages you can remove View permission for those pages for the role everyone and just grant view permissions for partners. To do this select the page and click its Permissions tab and set them (see partnerpagespermissions.png). Then for the specific partner pages you will also have to configure appropriate permissions. I will give an example with permissions for Partner A's page - see partnerapagepermissions.png.

    After applying these setting the result will be that non authenticated users will not be able to see partner pages. Users that do not belong to partner roles will also not be able to see or navigate to those pages.

    Greetings,
    Radoslav Georgiev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Register for webinar
6 posts, 0 answered