Adding content to template does not show on pages

Posted by Community Admin on 04-Aug-2018 14:47

Adding content to template does not show on pages

All Replies

Posted by Community Admin on 28-Apr-2011 00:00

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

Posted by Community Admin on 29-Apr-2011 00:00

Can someone please confirm?

Posted by Community Admin on 29-Apr-2011 00:00

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

Posted by Community Admin on 29-Apr-2011 00:00

@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? 

Posted by Community Admin on 29-Apr-2011 00:00

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!

Posted by Community Admin on 29-Apr-2011 00:00

@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.

Posted by Community Admin on 02-May-2011 00:00

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

Posted by Community Admin on 02-May-2011 00:00

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.

Posted by Community Admin on 04-May-2011 00:00

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

This thread is closed