Technical support This forum is closed.
Version 1.x > Technical support > help on calendar with multi-lingual View modes: 
User avatar
Member
Member
marie - 1/11/2007 9:15:01 PM
   
help on calendar with multi-lingual
Hello,
I have an event calendar that displays events. I create the link in my template for the event like so:

<a href='<%# ResolveUrl("~" + Container.DataItem["AliasPath"])%>.aspx'>
<%# Container.DataItem["CalendarEventTitle"]%>
</a><br />

It should take me to www.mydomain.com/event-list/event1.aspx but because I have multi-lingual established on my site it creates the link like so www.mydomain.com/en-us/event-list/event1.aspx, and that link is incorrect - it doesn't take me anywhere. So how do I get around have the en-us in my link?

Thanks in advance.

User avatar
Guest
admin - 1/20/2007 5:38:53 PM
   
Re: help on calendar with multi-lingual
Hello,

as with any other transformation, you need to use an expression like this to create the correct URL:

<%# Kentico.CMS.TreeEngine.Functions.GetUrl( DataBinder.Eval(Container, "DataItem.AliasPath")) %>

Best Regards,

User avatar
Member
Member
marie - 1/22/2007 7:03:25 PM
   
Re: help on calendar with multi-lingual
Thanks, but it didn't work. I am building this link in my template and here is the code I have with the URL code from above:

......................
<cc1:CMSCalendar ID="CMSCalendar1" runat="server" DayField="CalendarEventDate" SelectNodesClassName="cms.CalendarEvent" SelectNodesPath="/%">
<ItemTemplate>
<a href='<%# Kentico.CMS.TreeEngine.Functions.GetUrl( DataBinder.Eval(Container, "DataItem.AliasPath")) %>'>
<%# Container.DataItem["CalendarEventTitle"]%>
</a><br />
</ItemTemplate>
</cc1:CMSCalendar>
......................

This time is gave me an error "DataBinding: 'System.Data.DataRow' does not contain a property with the name 'AliasPath'."

Thanks.

User avatar
Guest
admin - 1/24/2007 10:13:25 AM
   
Re: help on calendar with multi-lingual
I'm sorry, the correct syntax for the CMSCalendar is actually a little different:

<a href='<%# Kentico.CMS.TreeEngine.Functions.GetUrl( Container.DataItem["AliasPath"]) %>'>

Best Regard,

User avatar
Member
Member
marie - 1/24/2007 3:54:19 PM
   
Re: help on calendar with multi-lingual
Thanks! It worked.