Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Recent Post getting unpublished blogs View modes: 
User avatar
Member
Member
jp.principio.mail-gmail - 1/3/2012 3:16:50 AM
   
Recent Post getting unpublished blogs
Hi,

Can you help me not to get the unpublished blogs in RecentPost.ascx?

It always gets the unpublished blogposts in all of my blogs.

Here's my code:

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="~/CMSWebParts/Blogs/fan/RecentPosts.ascx.cs" Inherits="CMSWebParts_Blogs_RecentPosts" %>

<cms:cmsrepeater ID="rptRecentPosts" runat="server" OrderBy="BlogPostDate DESC" ClassNames="cms.blogpost" Path="../%" />


Thanks,

JP

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 1/3/2012 5:48:55 AM
   
RE:Recent Post getting unpublished blogs
Hello,


you can use a property called: SelectOnlyPublished = "true" for the Repeater control. Please note that the Preview and Edit modes will always show all documents. Only the Live site mode reflects the published/unpublished documents.


Best regards,
Helena Grulichova