News Archive Widget? - General Discussions - General Discussions - Progress Community
 General Discussions

News Archive Widget?

  • News Archive Widget?
  • Hi there,

    I'm wondering what happened to the News Archive Widget? In the News widget I don't see any option for selecting an "archive" mode. Is there a way to do this with SF 4 out of the box or is this yet another standard tool that needs to be created manually? My goal is to have a news page that has a News List widget, displaying a list of 20 news items at a time and then I'd also like to have a News Archive widget in a side column that displays all the Months (grouped by year) that have news articles in them.

    If someone can point me to where this is and I'm just not seeing it that would be a great help!
    Thanks in advance.

    Cheers,
    Phill
  • Ok, so I've found an "Archive" widget that's under the "Navigation" section (odd place for it). The issue is that I have no idea what settings need to be set in order for it to display an archive of News. I would assume I might have to set Provider and ContentType? But I have no idea what these values would be, you'd think Content Type would be "news" but not that easy (is it ever?). 

    Can someone help me out here? Does any documentation exist on this widget?

    Thanks again,
    Phill
  • Ok, so I was able to answer my own question, just took some digging as it wasn't in the Designers manual or the Content Editors manual, but this one: http://www.sitefinity.com/4.0/documentation/User-guide/displaying-content-using-widgets/navigation-widgets-group/configuring-the-archive-widget.aspx

    ContentType Required: Telerik.Sitefinity.News.Model.NewsItem 

    But of course, things never work as expected. I have 1 news article and the archive widget displays two different months (Feb 2010 and Jan 2011). With ShowItemCount set to true it displays that there's one article in each. This is most likely caused by the fact that I have to start entering a number of news articles for the past year and attempted to set the published date of the first article to Feb 2010 which doesn't seem possible.

    So changing my own topic, is there a fix or a work around for being able to actually set the published date of a new article to something other than the CreatedDate (these should be two different fields!!)

    Thanks,
    Phill
  • Hello Phill Hodgkinson,

    You can create a dynamic field in which you can set the any field you like for example CreatedDateFromThePast. You can later use the Widget Template editor to display that date on the necessary location of your controls. To create a dynamic field use the following snippet:

    App.WorkWith()
       .DynamicData()
       .Type(typeof(NewsItem))
       .Field()
            .TryCreateNew("CreatedDateFromThePast", typeof(DateTime))
            .SaveChanges(true);

    Please let me know whether the proposed solution works for you. Excuse us for the late response and we look forward to answering any other questions you have.

    Kind regards,
    Hristo Borisov
    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
  • Hi Hristo,

    Your proposed solution doesn't address my problem. If I have to create a dynamic field to set a published date that's in the past then for any News item added going forward will use the published date and I'll have to create display widgets that can handle the two fields, that's just not a solution nor a viable work around.

    To me there has to be a way to set the published date to a previous date. I think all I'm looking for here is for you to confirm that this is a bug and that it's been logged and will be addressed.

    If you can think of any other way to get the PublishedDate behave properly I'd be open to suggestions.

    Cheers,
    Phill
  • Hi Hristo,

    I second Phill's suggestion to set the published date to a previous date.
    Please include this option in the next service pack.

    Best regards,
    Justus
  • I third it. In the meantime is there any problem with editing the database table that carries the date in directly?

    Cheers
    Richard
  • Hi everyone,

    Since it is a common request that we should support PublicationDate different from the current one, we will do our best to resolve the problem as soon as possible. I have logged the issue in our system and you should expect a bug fix in one of our future releases.

    Editing the database directly is something we strongly discourage as it may cause a lot of issues during upgrade. You can modify the database the way you like however we don't guarantee that the upgrade process will be flawless from then on.

    Thank you a lot for sharing your feedback with us, and thus making the system much more flexible and user friendly. Please let me know if you have any further questions.

    Best wishes,
    Hristo Borisov
    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
  • This is causing us some grief. Is this coming in the Q1 release?(PublicationDate different from the current one)
  • Ditto
  • Hi Kevin and all,

    We scheduled the implementation and will deliver a solution to this problem in 4.1. SP1 due at the end of May.

    As a temporary solution you can use Custom Fields and add a date field to capture such date creation date.
    This is not a perfect workaround but is something to use temporarily.

    We are sorry for the inconvenience that this is causing.

    Kind regards,
    Kalina
    the Telerik team


  • In order to use this work around, I have created the suggeted custom feild "PublishedCustom" using the SiteFinity Custom News Feild GUI.  Now I'm going to re-import my news articles (from the past) using the code below, but how do I bind my "published" method parameter below to my newly created custom field "PublishedCustom"???

     

     

     

    public static bool CreateNewsItemFluent(string newsTitle, string newsContent, string author, string url,DateTime published)
           
               Guid itemID = Guid.Empty;
               App.WorkWith().NewsItem().CreateNew()
                  .Do(nI =>
                  
                      nI.Title = newsTitle;
                      nI.DateCreated = published; 
                      nI.PublicationDate = published;
                      nI.ExpirationDate = published.AddYear(10);                  nI.UrlName = url;
                      nI.Author = author;
                      nI.Content = newsContent;
                  )
                    .Publish()
                    .SaveChanges();
               return true;
           

  • Hi Paul,

    There is DataExtensions (Telerik.Sitefinity.Model) methods of the Content item ( the news item) - GetValue and SetValue that can use.

    All the best,
    Ivan Dimitrov
    the Telerik team

  • 287262_NewsArchive.jpg
    Hi Guys,
    I've a problem with the Archive widget, It seems it has problem with items of the first day of month! please take a look at the attached screenshot.