Archive Control

Posted by Community Admin on 03-Aug-2018 18:18

Archive Control

All Replies

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

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 :)

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

Can someone please post an example of the LayoutTemplate please? I need to know what Evals to use for this control.

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

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

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

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?

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

I am experiencing the same issue as Jaymie, could someone please look into this for us?

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

Hello?
This is still an issue for me and I really need it sorting :(
Please help

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

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.

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

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.

Posted by Community Admin on 24-Mar-2011 00:00

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

Posted by Community Admin on 11-Aug-2011 00:00

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.

Posted by Community Admin on 11-Aug-2011 00:00

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

Posted by Community Admin on 11-Aug-2011 00:00

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.

Posted by Community Admin on 11-Aug-2011 00:00

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

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

Unsubscribing

This thread is closed