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

Forums / General Discussions / News archive

News archive

12 posts, 0 answered
  1. sathiyaseelan
    sathiyaseelan avatar
    82 posts
    Registered:
    26 Aug 2008
    05 May 2011
    Link to this post
    Hi,

    I am new to sitefinity 4. I have a news archive in my page which is displaying the "YearMonthDay" of all the news which was created. Could I show only previous year's/month's only in the list not the recent year/Month???

    In news module I tried to change published date but its coming today's date by default. How an admin user will use this if he wants "DateCreated" / "Published date" to be not today's date???. This is ridiculous.

    Also I cannot find advanced option in news archive widget as even though am an admin user...???

    Pls help me to sort this out??

    Thanks,
    sathya
  2. sathiyaseelan
    sathiyaseelan avatar
    82 posts
    Registered:
    26 Aug 2008
    09 May 2011
    Link to this post
    Any solution for this...
  3. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    08 Dec 2016
    09 May 2011
    Link to this post
    Hello sathiyaseelan,

    Create a custom field for your news items ( i created date/time field) and add code of your project.
    use this code.
    var newsAll = App.WorkWith()
                    .NewsItems()
                    
                    .ForEach(nI =>
                    {
     
                        var val = nI.GetValue("Old").ToString();
                        var ss = DateTime.Parse(val);
                        nI.PublicationDate = ss;
                        nI.DateCreated = ss;
                    })
                    .SaveChanges();

    The value " Old " is the name of the custom field I created to set the old date I wanted to be displayed and also fill in the custom field in the news where you want to change the date.

    Best wishes,
    Stanislav Velikov
    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
  4. Stephanie
    Stephanie avatar
    19 posts
    Registered:
    16 Mar 2011
    27 Jul 2011
    Link to this post
    Hello Stanislav,

       I have couple questions about the code you provided.  If I create a custom field for "Old,"  will that overwrite the publication date with the code provided?  If so, will that mess up the archiving feature at all?  Also, if I were to execute code like this where do I add it to my project?

    Thank you,

    Steph
  5. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    08 Dec 2016
    28 Jul 2011
    Link to this post
    Hello Stephanie,

    1. It will overwrite the current publication date
    2. The code will not change the publication date in all places where the news item appears like Revision History. If you refer to the Archive widget I think it takes the publication date displayed when you access the news module so the date there will be changed.
    3. To execute the script add a Webform to your SitefinityWebApp project and paste the code in its code behind file in Page_Load method. You will need to add the needed usings to reference the needed Sitefinity assemblies.

    Best wishes,
    Stanislav Velikov
    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
  6. Vakeel
    Vakeel avatar
    19 posts
    Registered:
    13 May 2014
    23 May 2014
    Link to this post

    hi,

    I am new in sitefinity 6.2 I have news archive in my page I want to display expired news in archive only in between 3 month to 9 month .How I show it

    please  help me as soon as possible

  7. Svetoslav Manchev
    Svetoslav Manchev avatar
    735 posts
    Registered:
    07 Dec 2016
    27 May 2014
    Link to this post
    Hi Vakeel,

    In order to achieve your need, you need two options:

    1) By dropping the News widget and under Edit menu filter the Items by date/period
     - or -
    2) By creation of your own custom widget, query the news items and group, filter and display them as you need.

    Regards,
    Svetoslav Manchev
    Telerik
     
    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 Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
  8. Mamta
    Mamta avatar
    3 posts
    Registered:
    22 Apr 2015
    12 Jun 2015
    Link to this post

     

    Hello Svetoslav

    I am new to sitefinity ( version 7). I have been trying to locate News Archive but didn't find it. I have created couple of news items and added news list on my News Page. Now I am trying to  create news archive ( based on year) . My navigation looks like  this Company->News and I want to show news archive like  company->news->2015.

    Thanks

     

  9. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    08 Dec 2016
    17 Jun 2015
    Link to this post
    Hello,

    For adding archive use the Archive widget on the page and configure it based on this documentation. For DataBuildOptions use "Year" and the years in which the news items were published will appear for filtering the news items using the archive.

    Regards,
    Stanislav Velikov
    Telerik
     
    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 Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
  10. Mamta
    Mamta avatar
    3 posts
    Registered:
    22 Apr 2015
    23 Jun 2015 in reply to Stanislav Velikov
    Link to this post

    Thanks Stanislav  .I have couple of more queries

    1) I need to add a search for all listed newsitems ,So I added  Search box and search result box but even after creating search Indexes only on newsitems ,it seems to search the entire site.

    2) I have been trying to create a custom news search box result template which display results same as in newsItems list and copied news list template to search result template but its not working.

    3) How do I set page url for  News Archive link  2015  ,"company->news->2015"? Clicking on 2015 should open up a new page  http://localhost/news/newsArchive but its opening on the same page I have this navigation widget which is  http://localhost/news

     

     

  11. Mamta
    Mamta avatar
    3 posts
    Registered:
    22 Apr 2015
    23 Jun 2015 in reply to Mamta
    Link to this post
    Figured out the third part ,setting up url for News Archive. Still looking answers for first two.
  12. Diana
    Diana avatar
    1 posts
    Registered:
    29 Jul 2015
    29 Jul 2015
    Link to this post
    We have unpublished news articles as they expire, but I would for them to be listed in an archive listing. I have set up the archive widget where I would like for it to show, but would like the unpublished articles to retain their original date when published showing in the archive listing. As it is now, when we publish them so that they show in the archive, it publishes the article with the current date. Is there a solution for this?
12 posts, 0 answered