More in this section

Forums / General Discussions / Archive Control

Archive Control

14 posts, 0 answered
  1. Roberto
    Roberto avatar
    18 posts
    Registered:
    12 Jan 2011
    04 Feb 2011
    Link to this post
    Hi,

    I really like the new Widget templates, but it doesn't cover everything I want to customise (which is a shame). I would like to customise the Archive control in a similar fasion (i.e. change the html for it) but I don't know where to start.
    I assume I can use a custom user control and just point the archive control to my custom one (LayoutTemplate and LayoutTemplatePath?), but I dont know what to put into that custom control to get the archive control working.

    Any help will be greatly appreciated :)
  2. Jaymie
    Jaymie avatar
    27 posts
    Registered:
    30 Jan 2009
    07 Feb 2011
    Link to this post
    Can someone please post an example of the LayoutTemplate please? I need to know what Evals to use for this control.
  3. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    07 Feb 2011
    Link to this post
    Hello,

    You should set the LayoutTempltePath property of the control. Below is the default one that you can map

    <%@ Control Language="C#" %>
    <%@ Register TagPrefix="sitefinity" Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI" %>
         
    <asp:PlaceHolder ID="plhTitle" runat="server" Visible="false">
        <h2 class="sfarchiveTitle">
            <asp:Literal ID="titleLabel" runat="server"/>
        </h2>
    </asp:PlaceHolder>
     
    <asp:Repeater ID="rptArchive" runat="server">
        <HeaderTemplate>
            <ul class="sfarchiveList">
        </HeaderTemplate>
        <ItemTemplate>
            <li class="sfarchiveListItem">
                <sitefinity:SitefinityHyperLink ID="linkArchive" runat="server" CssClass="selectCommand"></sitefinity:SitefinityHyperLink>
            </li>
        </ItemTemplate>
        <FooterTemplate>
            </ul>
        </FooterTemplate>
    </asp:Repeater>

    Another option is using css that are added to the page by your theme. Note that rptArchive is a required control and you cannot remove it.

    You can use Content properties with Eval.

    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
  4. Jaymie
    Jaymie avatar
    27 posts
    Registered:
    30 Jan 2009
    10 Feb 2011
    Link to this post
    Thanks for this, that really helped, but I have found a bug :(

    When I use a custom template (this seems to happen for all custom templates I use, which I am now assuming means I need to use code) I have found that if I change the publish date of a blog post or unpublish it, the custom archive list still shows the dates even though it lists no articles. Also, if I tell it to show the article count by the dates, they are wrong (because it shows the number of all posts regardless if it is published or not).

    Could you help me with this?
  5. Roberto
    Roberto avatar
    18 posts
    Registered:
    12 Jan 2011
    15 Feb 2011
    Link to this post
    I am experiencing the same issue as Jaymie, could someone please look into this for us?
  6. Roberto
    Roberto avatar
    18 posts
    Registered:
    12 Jan 2011
    21 Feb 2011
    Link to this post
    Hello?
    This is still an issue for me and I really need it sorting :(
    Please help
  7. Roberto
    Roberto avatar
    18 posts
    Registered:
    12 Jan 2011
    21 Feb 2011
    Link to this post
    I have tried changing the PublicationDate in the Widget template to DateCreated, ExpirationDate and LastModified but I can not get it to display the dates shown in my attachment.
  8. Roberto
    Roberto avatar
    18 posts
    Registered:
    12 Jan 2011
    21 Feb 2011
    Link to this post
    I have gotten around this by cheating.
    I created a custom column named CustomDate (which I have made require) and I have set the date to the dates I require. Then in my Widget Template, I use the datafield CustomDate instead of PublicationDate and it works fine.
    Now I am going to try to get my custom archive control to do the same.
  9. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    24 Mar 2011
    Link to this post
    Hi ,

    I saw what the problem is and you are right. Content items that are not published are added to the Archive control and this is not related to the template. This is a bug in GetArchieveItems method in ContentDataProviderBase class. I fixed the issue and it is ready for test, so our QAs will verify it and it will be included in the Q1 release.

    Regards,
    Ivan Dimitrov
    the Telerik team
  10. kevin
    kevin avatar
    6 posts
    Registered:
    19 Nov 2007
    11 Aug 2011
    Link to this post
    I would like to get the number of items for a month and display it in the link. what would the markup that look like? In  addition I need to do the same thing for the category control. Is there any way we could get a zip file of widget much like the external file zip file for introduced in 3.6. It would be a huge help to those of us who have to re-skin widgets on a regular basis.
  11. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    11 Aug 2011
    Link to this post
    Hello Kevin,

    The archive control has a property ShowItemCount that you can use to show the item count. There is a public property LayoutTemplatePath which you can use to map an external template. The default one is shown below.

    <%@ Control Language="C#" %>
    <%@ Register TagPrefix="sitefinity" Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI" %>
         
    <asp:PlaceHolder ID="plhTitle" runat="server" Visible="false">
        <h2 class="sfarchiveTitle">
            <asp:Literal ID="titleLabel" runat="server"/>
        </h2>
    </asp:PlaceHolder>
     
    <asp:Repeater ID="rptArchive" runat="server">
        <HeaderTemplate>
            <ul class="sfarchiveList">
        </HeaderTemplate>
        <ItemTemplate>
            <li class="sfarchiveListItem">
                <sitefinity:SitefinityHyperLink ID="linkArchive" runat="server" CssClass="selectCommand sfarchiveLink"></sitefinity:SitefinityHyperLink>
            </li>
        </ItemTemplate>
        <FooterTemplate>
            </ul>
        </FooterTemplate>
    </asp:Repeater>


    Kind regards,
    Ivan Dimitrov
    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
  12. kevin
    kevin avatar
    6 posts
    Registered:
    19 Nov 2007
    11 Aug 2011
    Link to this post
    What about the category control? does it follow the same pattern. I find myself needing to have custom templates more often than using the out of the box ones. is there a dump of widget controls? that would be extremely helpful.
  13. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    11 Aug 2011
    Link to this post
    Hello Kevin,

    There should be template package in the SDK that you can download.

    All the best,
    Ivan Dimitrov
    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
  14. Jaymie
    Jaymie avatar
    27 posts
    Registered:
    30 Jan 2009
    23 Nov 2011
    Link to this post
    Unsubscribing
14 posts, 0 answered