More in this section

Forums / Developing with Sitefinity / Custom ControlTemplate for all Blogs in 3.6.1936?

Custom ControlTemplate for all Blogs in 3.6.1936?

16 posts, 0 answered
  1. Victor
    Victor avatar
    44 posts
    Registered:
    10 Mar 2009
    26 May 2009
    Link to this post
    We have a custom version of ContentViewSingleItem.ascx we want to show on all blog pages. Is there a way to apply this custom template to all BlogPosts controls in the site without having to edit each one?

    There is a file we copied from your External Templates into ~/App_Data/Configuration/Telerik.Sitefinity.Configuration.ControlsConfig.xml but that doesn't seem to be working.

  2. Sean
    Sean avatar
    271 posts
    Registered:
    31 May 2006
    27 May 2009
    Link to this post
    Hi Victor,

    If you already had set the TemplatePaths in your BlogPosts already then it will ignore the settings in your ControlConfig file.

    You could either manually remove those, or you could edit your database (not recommended), or you could download the Replace Tool and modify it to include looking in your BlogPost controls.

    Cheers
    Sean


  3. Victor
    Victor avatar
    44 posts
    Registered:
    10 Mar 2009
    27 May 2009
    Link to this post
    We have about 5 pages with BlogPosts controls in them, TemplatePaths is set in only one of them just as a test since any external template set in ControlsConfig.xml seems to be ignored.

    If I remove TemplatePaths from that control it uses embedded one regardless of what I set in controlsconfig. This is with latest patch of Sitefinity Standard (3.6.1936)

  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    27 May 2009
    Link to this post
    Hello Victor,

    Please take a look at the following Blog post. Mapping of the presentation modes is different that the other templates. Mapping ContentViewDesigners and working with Presentation Modes

    Let us know if there is anything else that we can do for you.

    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.
  5. Sean
    Sean avatar
    271 posts
    Registered:
    31 May 2006
    27 May 2009
    Link to this post
    Hi Victor,

    Please could you post your ControlConfig here so we can see what it looks like.

    Thanks
    Sean
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    27 May 2009
    Link to this post
    Hello Sean,

    ControlsConfig setting will not be applied for the presentation mode. The post I made describes the ways for mapping a presentation mode to ContentView based controls. Also the templates that should be mapped are
    located under ~/Sitefinity/Admin/ControlTemplates/Blogs/Modes. For instance ListPageMaster.ascx and ListPAgeDetail.ascx

    If the approach is different, please feel free to continue the discussion.

    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.
  7. Sean
    Sean avatar
    271 posts
    Registered:
    31 May 2006
    27 May 2009
    Link to this post
    Hi Ivan,

    Yeah sorry about that I just realised I missed your post...

    Cheers
    Sean
  8. Victor
    Victor avatar
    44 posts
    Registered:
    10 Mar 2009
    27 May 2009
    Link to this post
    it doesn't work, here is what I did:

    1. Downloaded Sitefinity_3_6_1936_standard_ExternalTemplates.zip, unzip and copy over development website
    2. Copy Telerik.Sitefinity.Configuration.ControlsConfig.xml from zip file to ~/App_Data/Configuration (overwrote the one I had there)
    3. Modified ~/Sitefinity/Admin/ControlTemplates/Blogs/BlogPostsControlDesigner.ascx, changed listPageMode as follows:

    <sf:PresentationMode ID="listPageMode" runat="server"  
                                                   ModeTitle="List &amp; page"  
                                                   ModeSettingsId="ModesSettings1"  
                                                   MasterTemplatePath="~/Sitefinity/Admin/ControlTemplates/Blogs/Modes/ListPageMaster.ascx"  
                                                   DetailTemplatePath="~/MyUserControls/ControlTemplates/Blogs/ContentViewSingleItem.ascx"  
                                                   CssClass="pageListMode" 
                                                   SelectedCssClass="selectedOption pageListMode" 
                                                   > 

    Tested pages with blogposts control, they are using embedded template.

    Am I missing something?

  9. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    27 May 2009
    Link to this post
    Hi Victor,

    1. For DetailTemplatePath use ListPageDetail.
    2. After you have made the changes, remove the control( BlogPosts) from your page, publish the page. Then open the page for edit mode and add BlogPosts control. The custom template should be loaded. Another option is changing the presentation mode( for instance ExpandableList) and saving the control. Then open the control again and choose modified presentation mode. Save the control.

    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.
  10. Victor
    Victor avatar
    44 posts
    Registered:
    10 Mar 2009
    27 May 2009
    Link to this post
    1. For DetailTemplatePath use ListPageDetail.

    ok, now listPageMode looks like this:

                        <sf:PresentationMode ID="listPageMode" runat="server"  
                                                   ModeTitle="List &amp; page"  
                                                   ModeSettingsId="ModesSettings1"  
                                                   MasterTemplatePath="~/Sitefinity/Admin/ControlTemplates/Blogs/Modes/ListPageMaster.ascx"  
                                                   DetailTemplatePath="/Sitefinity/Admin/ControlTemplates/Blogs/Modes/ListPageDetail.ascx"  
                                                   CssClass="pageListMode" 
                                                   SelectedCssClass="selectedOption pageListMode" 
                                                   > 
     

    Then I edited ~/Sitefinity/Admin/ControlTemplates/Blogs/Modes/ListPageDetail.ascx wrapping the Post a comment section in a non-visible panel:

                <fieldset class="sf_postNewComment"
                    <legend>Post a comment!</legend> 
                    <asp:Panel runat="server" ID="pnlPostComment" Visible="false"
                        <ol> 
                           <!-- post comment stuff here --> 
                        </ol> 
                    </asp:Panel> 
                </fieldset> 


    2. After you have made the changes, remove the control( BlogPosts) from your page, publish the page. Then open the page for edit mode and add BlogPosts control. The custom template should be loaded

    Deleted blogposts control from page, publish, added control back, publish, test, post comment form still shows, fail.

    Does this stuff work for you?

  11. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    28 May 2009
    Link to this post
    Hi Victor,

    It works perfectly at my end. I am sending you the templates I have used. Please check out the video I have prepared.

    All the best,
    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.
  12. Victor
    Victor avatar
    44 posts
    Registered:
    10 Mar 2009
    28 May 2009
    Link to this post
    I really appreciate your effort but still doesn't work.

    Just in case something was wrong with my setup I created a new blank sitefinity site from Sitefinity_3_6_1936_standard_BlankProject.zip, unpacked external templates on top of it (from Sitefinity_3_6_1936_standard_ExternalTemplates.zip)

    Then I put the files you attached on top and verified everything based on your video, still fail. Only way I can get external templates to work is by setting them in advanced section of each blogposts control.

    I noticed in your video you are using a slightly different version of sitefinity, at least the folder you are working from has a "3_6_1927_2" on it.


  13. Victor
    Victor avatar
    44 posts
    Registered:
    10 Mar 2009
    28 May 2009
    Link to this post
    Hello again,

    Just to let you know I tested this against a backup from Sitefinity Standard 3.6.1870 and it worked fine.

    It doesn't work in latest Sitefinity release: 3.6.1936

  14. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    28 May 2009
    Link to this post
    Hi Victor,

    I have just set up a new 3.6 - 1936 build project. There is no problem with the mapping.

    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.
  15. Victor
    Victor avatar
    44 posts
    Registered:
    10 Mar 2009
    28 May 2009
    Link to this post
    Thanks, I have no idea how, but it is working now.
  16. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    28 May 2009
    Link to this post
    Hi Victor,

    I am glad to hear that everything is working fine now after the discussion in this thread.

    All the best,
    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.
Register for webinar
16 posts, 0 answered