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

Forums / Developing with Sitefinity / Can I categorize pages?

Can I categorize pages?

11 posts, 1 answered
  1. andersleet
    andersleet avatar
    155 posts
    Registered:
    03 Jun 2009
    30 Jul 2009
    Link to this post
    Sorry for the bland/nondescript thread title :P  Here is the situation:

    I have several pages, some of them need only be visible to certain users. Is there a way I can add a category or some other sort of 'marker' to the pages so I can differentiate what should be accessible by whom?

    Thanks guys!
    anders
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    30 Jul 2009
    Link to this post
    Hello andersleet,

    The easiest way that I could come up is using Group pages or some identifier in the title. The group pages approach will allow you to hide/show a bunch of pages to some of your user roles.

    Kind regards,
    Ivan Dimitrov
    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. andersleet
    andersleet avatar
    155 posts
    Registered:
    03 Jun 2009
    30 Jul 2009
    Link to this post
    OK, I was thinking that might be an avenue to take.  I can change the visibility of page groups from code-behind, correct?

    thanks!
    anders
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    30 Jul 2009
    Link to this post
    Hi andersleet,

    "visibility of page groups from code-behind"

    Yes if you are using navigation control you can subscribe for ItemDataBound or PageLoad event.

    Greetings,
    Ivan Dimitrov
    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. andersleet
    andersleet avatar
    155 posts
    Registered:
    03 Jun 2009
    30 Jul 2009
    Link to this post
    So I will want to be doing the showing/hiding inside of the navigation control?

    regards,
    anders
  6. andersleet
    andersleet avatar
    155 posts
    Registered:
    03 Jun 2009
    30 Jul 2009
    Link to this post
    I use a RadTabStrip for navigation. I do not see where I can specify a control template or some other sort of code-behind. Can you please elaborate on how to go about doing this?

    thanks,
    anders
  7. andersleet
    andersleet avatar
    155 posts
    Registered:
    03 Jun 2009
    31 Jul 2009
    Link to this post
    shameless bump :P

    Any more information for me ivan?

    thanks,
    anders
  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    31 Jul 2009
    Link to this post
    Hi andersleet,

    I use a RadTabStrip for navigation. I do not see where I can specify a control template or some other sort of code-behind. Can you please elaborate on how to go about doing this?

    I am sorry but could you elaborate a bit more about the quoted text. How you use this RadTabStrip control? Have you declare it in a user control or you are using it from somewhere else( Sitefinity's Toolbox maybe)

    Best wishes,
    Ivan Dimitrov
    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.
  9. andersleet
    andersleet avatar
    155 posts
    Registered:
    03 Jun 2009
    31 Jul 2009
    Link to this post
    Hi Ivan,

    I am sorry, I actually used a Site Tabstrip, not a RadTabStrip. Are they the same thing, just one (site tabstrip) is linked to the file structure of the site? I dragged it from the toolbox and placed it on my template.

    Regards,
    anders
  10. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    31 Jul 2009
    Link to this post
    Hello andersleet,

    Open Sitefinity/UserControls/Navigation35/SiteTabStrip.ascx.cs. There override PreRender method. Below is a sample code:

        protected override void OnPreRender(EventArgs e) 
        { 
            base.OnPreRender(e); 
            IList<RadTab> tabs = this.RadTabstrip1.GetAllTabs(); 
            foreach (RadTab tab in tabs) 
            { 
                // add more conditions. You can use UserManager class for getting the user. 
                if (tab.Text == "Sitefinity"
                { 
                    tab.Visible = false
                } 
            } 
     
        } 
     


    Best wishes,
    Ivan Dimitrov
    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.
    Answered
  11. andersleet
    andersleet avatar
    155 posts
    Registered:
    03 Jun 2009
    31 Jul 2009
    Link to this post
    Thanks Ivan, I should be able to get this to work now. I will let you know if I have more questions.

    Thanks!
    anders
Register for webinar
11 posts, 1 answered