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

Forums / Developing with Sitefinity / Is there a way to archive generic content and display a list of archived news items?

Is there a way to archive generic content and display a list of archived news items?

10 posts, 0 answered
  1. Alex
    Alex avatar
    10 posts
    Registered:
    21 Nov 2007
    19 Mar 2008
    Link to this post
    Hi all,
    A few questions regarding expiring content:

    Is there a way to archive/expire at a certain date generic content modules?
    Is there a to view all news items that have expired?
    Does the search return expired items?

    Thanks,

    Alex
  2. Nikifor
    Nikifor avatar
    232 posts
    Registered:
    18 May 2013
    21 Mar 2008
    Link to this post
    Hello Alex,

    Thank you for getting in touch with us.

    Following are answers to your questions:

    1. Is there a way to archive/expire at a certain date generic content modules?
    We provide such functionality out-of-the-box only for the News module. When a News item expires, it is send automatically to the archive. The data is stored in database tables.In order to do that for the Generic Content module you need to make some customizations. You could add a custom property in the form of a meta field (see the topic  in the online version of the Developer Manual). For the purpose, create a custom control that overrides the Content View control, and inside it implement the filter that will sort out the content by date.

    Please see the following topics in the Developer Manual that might help you in the development process:
    Also, the following KB article should be useful to you: Content View Control


    2. Is there a to view all news items that have expired?
    This functionality is provided by the Archive control which is placed in the toolbox, in the Generic Content group.  Open the Properties of the control, add News to the ProviderName property in the Data section. Click I'm Done. Once you place the control on a page, you can browse the expired News content.

    3. Does the search return expired items?
    The search returns expired items only in case the Index is created before they have expired.

    Hope that the provided information is helpful. Please do not hesitate to contact us in case you have any additional questions.

    Best wishes,
    Nikifor
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Chris
    Chris avatar
    2 posts
    Registered:
    10 Jul 2007
    11 Apr 2008
    Link to this post

    Hi there,

    Is there a way to show only archived items from a certain category using the archive control? We use our news module for a few different things and would like an archive section for each. Thanks

    Chris

  4. Nikifor
    Nikifor avatar
    232 posts
    Registered:
    18 May 2013
    15 Apr 2008
    Link to this post
    Hello Chris,

    If we have understood correctly, you want to display News items sorted by categories, which have already expired and do not show by a News List control. You can use the CategoriesList control instead of the Archive control for this purpose. Once you place the control on a page, there are two main settings which should be added in the control properties.

    • The first one is ProviderName in the Data section - the name of the News provider (the default one is News)
    • Afterwards, set the CategoryContentUrl in the Behavior section - the address of the page where the News List control is placed
    Please let us know if this is what you need and if you need any additional information for setting this up.
     
    Kind regards,
    Nikifor
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  5. Chris
    Chris avatar
    2 posts
    Registered:
    10 Jul 2007
    15 Apr 2008
    Link to this post
    This option does not quite work for us. Here is an example of what we are looking for:

    We would like to have a News List showing current active job postings and then a link at the bottom saying show past job postings. This link would go to another page that shows only job postings that have expired in the same format.

    What I would like to see a way to select only the Not Active news items in the News List. That option is not in dropdown. This would make things much easier. There's only Active, Published, Single Date and All I would love to see the option for Not Active in there. Can I do this myself using the Filter Expression field?

    I hope this makes sense. Thanks for your help.
  6. Nikifor
    Nikifor avatar
    232 posts
    Registered:
    18 May 2013
    21 Apr 2008
    Link to this post
    Hello Chris,

    Maybe I did not provide a clear enough description in my first post. Actually, the suggested control does exactly what you are aiming at. You can place it below the News List control and every time you click on the Category name, all stored news for this category will be displayed. The only thing which will be different from your requirements is that the link would have the name of the Category assigned to the stored items. I have attached an image for your convenience.

    Sincerely yours,
    Nikifor
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  7. syed
    syed avatar
    22 posts
    Registered:
    05 Mar 2009
    15 Apr 2010
    Link to this post
    Hi there

    how can we display the news list as per attached one.

    thank you in advance

    thanks
    syed
  8. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    16 Apr 2010
    Link to this post
    Hi syed,

    Thank you for using our services.

    You will have to modify the control template for the news view when it is in list mode. Then you will also have to apply your own styles in order to align items like that. You can find more information on how to achieve this:
    How to map a view to an external template
    How to apply custom style sheets to Sitefinity Content View controls

    Greetings,
    Radoslav Georgiev
    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.
  9. syed
    syed avatar
    22 posts
    Registered:
    05 Mar 2009
    17 Apr 2010
    Link to this post
    hi george

    Thanks for your reply.
    i hope that you misunderstand my questions.
    How we can customize the Repeater control to display the 4 column of items in one row(like below):

    item1    item2   item3   item4
    item5    item6   item7 

    Is this acheivable ? if not, how can i transfered this into DataList control. As a newbie to Asp.net, i am struggling lot to do that.

    Your help is really much much appreciated.


    Thanks
    Syed
  10. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    18 Apr 2010
    Link to this post
    Hi syed,

    It is possible. You need to add two literal controls inside the declaration of repeater you want to modify( in your case you need a custom control that inherits from NewsView)

    <asp:Repeater  ID="repater" runat="server">
                <ItemTemplate>
                <asp:Literal Visible="false" ID="begin" Text="<ul class='sf_CustomNewsClass'>" runat="server" ></asp:Literal>
                    <li>
                      // other controls goes here
                    </li>
                    <asp:Literal Visible="false" ID="end" Text="</ul>" runat="server" ></asp:Literal>
                </ItemTemplate>
            </asp:Repeater>

    You have to apply css class over the transformed list

    <style type="text/css">
    .sf_CustomNewsClass
    {
        float:left;
    }
        li {
       list-style : none;
       margin: 0;
       padding: 0;
      
         
    }
      
    </style>

    You need to access the ItemDataBound event of the repeater and render the begin and end tags properly

    sample

    Literal beginningUl = e.Item.FindControl("begin") as Literal;
    Literal endUl = e.Item.FindControl("end") as Literal;
     
        if (beginningUl != null)
        {
            beginningUl.Visible = true;
            endUl.Visible = false;
        }

        if (endUl != null)
        {
            endUl.Visible = true;
            beginningUl.Visible = false;
        }

    You could access the NewsView repeater by overriding the CreateContentList method.

    All the best,
    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.
Register for webinar
10 posts, 0 answered