Adding content to template does not show on pages
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
Can someone please confirm?
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
@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?
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!
@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.
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();
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();
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