More in this section

Forums / Bugs & Issues / Adding content to template does not show on pages

Adding content to template does not show on pages

9 posts, 0 answered
  1. Richa
    Richa avatar
    69 posts
    Registered:
    04 Jun 2009
    28 Apr 2011
    Link to this post
    Hello

    We are developing a site in 4.1 and content added to templates using Generic content block does not now show up on pages in the site unless you open that page for editing and hit Publish.

    Is this a known bug?

    -Thanks
    Richa
  2. Richa
    Richa avatar
    69 posts
    Registered:
    04 Jun 2009
    29 Apr 2011
    Link to this post
    Can someone please confirm?
  3. Gabe Sumner
    Gabe Sumner avatar
    440 posts
    Registered:
    09 Sep 2007
    29 Apr 2011
    Link to this post
    All Sitefinity pages are being cached by default.  Updating the template does not automatically expire the cache of all the pages that use the template.  Clicking Publish on the page is a way to expire & refresh the cache.  Alternately the web application can be restarted or caching could be disabled.

    Expiring the cache automatically, based on the underlying template being updated, is probably something we should consider though.

    Gabe Sumner
    Telerik | Sitefinity CMS
  4. Phill Hodgkinson
    Phill Hodgkinson avatar
    362 posts
    Registered:
    10 Nov 2004
    29 Apr 2011
    Link to this post
    @Gabe, don't mean to hijack this thread but I'm curious about the internal build. I received no response from support or in my other thread. We were told an internal build was to be released today, any status on this? 
  5. Venkata
    Venkata avatar
    14 posts
    Registered:
    14 Aug 2009
    29 Apr 2011
    Link to this post
    Hello -

    I am running into the same issue.
    I tried what Gabe suggested but I feel I am missing something here.
    I recycled my Application Pool, I restarted my website in IIS but the page still serves the old content.
    Do you have any other suggestions to expire cache?

    Thanks!
  6. Phill Hodgkinson
    Phill Hodgkinson avatar
    362 posts
    Registered:
    10 Nov 2004
    29 Apr 2011
    Link to this post
    @Venkata have you tried to disable caching globally? Go to Administration > Settings > Advanced > Output Cache Settings and then disable the caching there. Just to be safe, I'd recommed a quick site restart by editing web.config.

    Hope that helps.
  7. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    Registered:
    30 Oct 2017
    02 May 2011
    Link to this post
    Hello Richa,

    Please excuse us for the inconvenience caused. This is a known bug and we are working on delivering a solution for it. You can track the bug status and vote for it in PITS on this public URL. In the meantime, please try creating a blank  ASP.NET WebForm and putting the following sample code in the codebehind file.
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using Telerik.Sitefinity;
    using Telerik.Sitefinity.GenericContent.Model;
    using Telerik.Sitefinity.Modules.Pages;
    using Telerik.Sitefinity.Pages.Model;
      
    namespace SitefinityWebApp
    {
        public partial class WebForm1 : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
                var pageNodes = App.WorkWith()
                                             .Pages()
                                             .LocatedIn(Telerik.Sitefinity.Fluent.Pages.PageLocation.Frontend)
                                             .Where(pN => pN.Page.Status == ContentLifecycleStatus.Live)
                                             .Get()
                                             .ToList();
                foreach (PageNode p in pageNodes)
                {
                    var myId = p.Page.Id;
                    var manager = PageManager.GetManager();
                    var myDraft = manager.EditPage(myId, true);            
                    manager.PublishPageDraft(myDraft, true);
                    manager.SaveChanges();
                }
      
      
      
            }
        }
    }
    For your convenience I'm attaching a copy of my webpage to this thread, you can place it in your SitefinityWebApp project, build it and navigate to the page after changing something in a template, and it will republish all published pages. If you need any further information, please do not hesitate to write back.

    Kind regards,
    Boyan Barnev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  8. Venkata
    Venkata avatar
    14 posts
    Registered:
    14 Aug 2009
    02 May 2011
    Link to this post
    Code attached (WebForm1.rar) doesn't work. It throws a object reference not set to instance error.

    However if you use the below code it works
    var pageNodes = App.WorkWith()
                                             .Pages()
                                             .LocatedIn(Telerik.Sitefinity.Fluent.Pages.PageLocation.Frontend)
                                             .Get()
                                             .Where(pN => pN.Page.Status == ContentLifecycleStatus.Live)
                                             .ToList();
                foreach (PageNode p in pageNodes)
                {
                    var myId = p.Page.Id;
                    var manager = PageManager.GetManager();
                    var myDraft = manager.EditPage(myId, true);                
                    manager.PublishPageDraft(myDraft, true);
                    manager.SaveChanges();
                }

    I just switched the Get() and Where() calls in the statement which gets pageNodes.

  9. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    Registered:
    30 Oct 2017
    04 May 2011
    Link to this post
    Hi Venkata,

    I am glad that you found the provided code useful, and thank you for the correction, code worked fine on my side. The good news is that the bug has been fixed, and a fix is available in the latest internal release from yesterday - you can check with it.

    All the best,
    Boyan Barnev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
9 posts, 0 answered