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

Forums / Developing with Sitefinity / Common Sub Pages

Common Sub Pages

2 posts, 0 answered
  1. Smitha
    Smitha avatar
    22 posts
    Registered:
    29 Oct 2008
    17 Dec 2008
    Link to this post

    Hi!

    My site map is similar to the following,

    --Page1
    ----PageA(SubPage)
    ----PageB(SubPage)
    ----PageC(Subpage)
    ----PageD(Subpage)
    --Page2
    ----PageF(Subpage)
    ----PageB(Subpage)


    As you can see i am using the same subpage (PageB) below Page1 and Page2.

    I dont want to recreate this subpage under page 2 as i will have 2 maintain the same page in 2 diffrent places.
    I did come across the another URL option in page properties - page URL but donot want to use this as it doesnot change in the Breadcrumb options.

    When i am in PageB from Page1 i should see the following breadcrumb
    >Page1 >Pageb
    and when i am in PAgeB from Page2 i should see the following breadcrumb
    >Page2 >Pageb

    Please advice.

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    20 Dec 2008
    Link to this post
    Hi Smitha,

    As I see it, it is not so easy to do this, because BreadCrumb control is bound to SiteMapDataSource control. I would try to synchronize all pages.This will allow you to make changes only to one page and they will apply to all pages with the same content. Here is some code example.

    using System; 
    using Telerik.Cms; 
     
    public static class PageManagerHelper 
        static PageManagerHelper() 
        { 
            CmsManager.Executed += new EventHandler<Telerik.ExecutedEventArgs>(CmsManager_Executed); 
        } 
     
        static void CmsManager_Executed(object sender, Telerik.ExecutedEventArgs e) 
        { 
            if (e.CommandName == "UpdatePage"  
                || e.CommandName == "Publish"
            { 
                ICmsPage page = e.Data as ICmsPage; 
                if (page != null 
                    && page.StaticUrl.Equals("~/Page1/PageB.aspx")) 
                {  
                    // Syncronize changes to all other PageB pages 
                } 
            } 
        } 
     
     

    I saw that methods for duplicating are internal (internal static void Copy(PageContentBase source, StagedPage target)) and could not come up with anything else.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
2 posts, 0 answered