News Archive Widget?

Posted by Community Admin on 03-Aug-2018 22:58

News Archive Widget?

All Replies

Posted by Community Admin on 26-Jan-2011 00:00

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

Posted by Community Admin on 27-Jan-2011 00:00

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

Posted by Community Admin on 27-Jan-2011 00:00

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

Posted by Community Admin on 01-Feb-2011 00:00

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

Posted by Community Admin on 01-Feb-2011 00:00

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

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

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

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

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

Cheers
Richard

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

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

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

This is causing us some grief. Is this coming in the Q1 release?(PublicationDate different from the current one)

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

Ditto

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

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


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


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;
       

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

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


Posted by Community Admin on 23-Jul-2011 00:00

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.

Posted by Community Admin on 27-Jul-2011 00:00

Hi Saeed,

Please take a look at this forum thread, which discusses a similar issue, I believe you might find it useful. Generally the problem might arise if you have different dates set for the same content item, For example, if you have a news item, due to the ContentLifeCycle implementation that item has a Master state (the one you see in the grid when going to Content->News), a Live state (the one you see on the frontend in the News widget) and also a Temp state (when you open an item for editing). Besides that, an item has DateCreated and PublicationDate. In case there' s some discrepancy between them, the News widget will display one date for the same item on the forntend and a different one in the backend (since DateCreated is used for backend and PublicationDate for frontend). This can also cause the archive widget to display unexpected results.
I see that you have specified Sitefinity 4.0 product version. We used to have some problems with the archive widget functionality, displaying the above mentioned symptoms,a s well as some items that were in draft state. The bugs have been fixed in our Sitefinity 4.1 version, so I would recommend you to upgrade a copy of your project to the latest officially supported version and test if the issue reproduces there (please have in mind that we support up to two versions back upgrade path, so in case you're running Sitefinity 4.0 official release, you should upgrade to Sitefinity 4.0 SP1 and then to Sitefinity 4.1 SP1 and then to the latest officially supported version Sitefinity 4.1 SP3)

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

This thread is closed