+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / News list on CommunityNewsListHome not showing news items

News list on CommunityNewsListHome not showing news items

7 posts, 2 answered
  1. Klemen Slavič
    Klemen Slavič avatar
    30 posts
    Registered:
    24 Jul 2009
    10 Nov 2010
    Link to this post
    As stated, I've modified the original Community template while keeping the original news list module, but entering new news items doesn't show any on the home page or on the dedicated News.aspx page.

    One of the news items has a Thumbnail, Summary and Author set, while the other only has only Title and Content. None of them shows up on the latest news list. Both are uncategorized.

    Am I missing something? Should I be categorizing the news items?

    Also, I'm using a localized version of the site using persistenceMode="PathPrefix" defaultCulture="sl" cultures="sl, en" autoSetClientLanguage="False", but I haven't seen any settings that would let me change the culture of the individual news item.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    10 Nov 2010
    Link to this post
    Hello Klemen,

    1. Make sure that the news item has been published.
    2. Check whether the page you are looking at uses the same culture as the culture under which you have created the news item. The NewsView control gets the items based on the CurrentUICulture.
    3. Open NewsView control in edit mode and check its FiltersExpression property which default value is
    "Publication_Date <= "#now" AND Expiration_Date > "#now"

    4.To create different language versions of a module, you have to

    • Find the <cmsEngine> section in the application web.config file and set the allowLocalizationattribute to true.

    <cmsEngine defaultProvider="Generic_Content">
    <providers>
    <clear/>
    <add name="News"
    visible="True"
    defaultMetaField="Name"
    securityProviderName=""
    allowLocalization="True" ....


    Setting this enables you to create versions of the content items for all the site cultures and
    display them by switching the languages in the selector on the live web site.

    • Find the <metaFields> section and set the localizable attribute to true for all fields that you want to localize.
    To make the Titlefield of theNews module localizable, for example, add localizable attribute

    <add key="News.Title" valueType="ShortText" visible="True" searchable="False" localizable="True"
    sortable="True"
    defaultValue="Add description here"/>


    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Klemen Slavič
    Klemen Slavič avatar
    30 posts
    Registered:
    24 Jul 2009
    11 Nov 2010
    Link to this post
    The settings you've described did enable me to edit news items in different cultures, so I've deleted the two existing news items and created a new entry in the sl culture (I can verify this, since I'm seeing a language selection on the right hand side when viewing a news item), but the item is still not listing on the news page. The publication time is set a day in the past and the expiration date is well in the future (year 2099) and the status in the news list view shows Published.

    The NewsView control (contained on the News.aspx page) is configured to show all news items, regardless of categorization, but it still doesn't show any news items, even when I switch cultures (eg. from /en/News.aspx to /sl/News.aspx and vice versa). The frontpage news list control exhibits the same behavior.
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    11 Nov 2010
    Link to this post
    Hi Klemen,

    Could you try the following

    1. Create a custom control that inherits from NewsView
    2. Override CreateDataSource method  and call GetContent method and see what will will be returned.  This will allow you to attach the Visual Studio deugger to the method.

    sample code

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using Telerik.News.WebControls;
    using System.Web.UI.WebControls;
    using System.Web.UI;
    using Telerik.Cms.Engine;
    using Telerik.Cms.Web;
    using Telerik.Cms.Web.UI;
    using Telerik.Cms.Engine.ContentViewFiltering;
    using Telerik.Libraries;
    using System.ComponentModel;
    using Telerik.News;
    using Telerik.Web;
    using System.Collections;
     
     
     
    public class NewsViewCustomControl : NewsView
    {
     
        public override string ItemListTemplatePath
        {
            get
            {
                return "~/Sitefinity/ControlTemplates/News/ListPageMaster.ascx";
            }
     
        }
     
        public override string SingleItemTemplatePath
        {
            get
            {
                return "~/Sitefinity/ControlTemplates/News/ListPageDetails.ascx";
            }
     
        }
     
     
        public override Type LocalizationAssemblyInfo
        {
            get
            {
                return this.GetType();
            }
            set
            {
                base.LocalizationAssemblyInfo = value;
            }
        }
     
        public override Type AssemblyInfo
        {
            get
            {
                return this.GetType();
            }
            set
            {
                base.AssemblyInfo = value;
            }
        }
     
        public override bool AllowPaging
        {
            get
            {
                return false;
            }
            set
            {
                base.AllowPaging = value;
            }
        }
     
        public override int MaximumListCount
        {
            get
            {
                return 100;
            }
            set
            {
                base.MaximumListCount = value;
            }
        }
     
     
         
     
     
        protected override IList CreateDataSource()
        {
           // this comes from the base
           //var allItems =  base.CreateDataSource();
           // make sure that the Manager uses your provider - the default is "News"
            System.Collections.IList items = Manager.GetContent();
            return items;
        }
     
     
    }

    Inside CreateDataSource you can set the current UI culture System.Threading.Thread.CurrentThread.CurrentUICulture = cult; before calling GetContent, because the content is retrieved depending on CurrentUICulture

    You can get the control templates - ListPageMaster and ListPageDetails
    from your account Downloads section. There is an archive with all External Templates.
    You could see this issue if you have changed the default culture of the website. I am not able to replicate this issue locally.

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
    Answered
  5. Klemen Slavič
    Klemen Slavič avatar
    30 posts
    Registered:
    24 Jul 2009
    11 Nov 2010
    Link to this post
    I've copied the class to my project and added the two templates (though I had to remove some calls to resource binders in ListPageMaster.ascx) and the news item shows up on /News.aspx and /sl/News.aspx inside the custom control I've put on the News.aspx page, but not on /en/News.aspx, which is the behaviour I expected. Just in case, I've put both the vanilla NewsView control on the same page as well to see if the default control shows anything; it doesn't.

    And yes, I've started out the project with the en as default culture, then changed the setting to sl after inserting the language resources into the bin folder and web.config.
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    11 Nov 2010
    Link to this post
    Hello Klemen,

    1. There is some filter on the default control
    2. The problem could be that you have changed the default culture and in this case the old items - created before changing the language will not appear. You can check the language ID inside [sf_GCMetaData] where 127 is for the invariant culture which is the default one.

    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
    Answered
  7. Klemen Slavič
    Klemen Slavič avatar
    30 posts
    Registered:
    24 Jul 2009
    11 Nov 2010
    Link to this post
    Per your tip, I've deleted and re-added the NewsList control to News.aspx and now it appears to function correctly. I'm not sure I've added any filters, but it seems switching and enabling localization somehow mucked up the filter parameters on the initial control.

    Anyways, I think this is solved now. Thanks for the help.
Register for webinar
7 posts, 2 answered