November Happy Hour will be moved to Thursday December 5th.

DataFactory Language bug?

Vote:
 

Hi, i have the following case, in the bottom of the page, our client can add logo's of their partner them self, they are stored in a "data" folder, which are not browsable their self, but only to build up a list of logo's with links to their partner page in the site.

So the item consists of something like:

-Logo
-Name
-AirlineLink

All of them don't have a unique value per language.

BUT: most important the AirlineLink which points to a Content page in the website IS multilingual, and here comes the problem.

Let's say i am in the dutch site, and i retrieve the Childs with the following code:

var x = DataFactory.Instance.GetChildren(SitewideProperties.AirlineMemberContainer, LanguageSelector.AutoDetect());

The AirlineLinks are not correct, they always return the Url to the English versions, i did offcourse testing of the Language pass through is correct.
I even get the correct items, because when i change a name in the Dutch language branch, i retrieve the translated item, but the link is still pointing to the English version of the Page.
 
Does someone know or this i bug, and or there is a work around for this?
 

 

 

#52552
Aug 02, 2011 12:14
Vote:
 

Do you mean that you get back the correct PageData object for that language, but that the LinkUrl that gets rendered goes to the English version?

Frederik

#52557
Aug 02, 2011 23:14
Vote:
 

Well, i get back the correct "logo" items, but a colleague already pointed that the AirlineLink is a pagereference.
But i assumed, that it would return the correct language branch automatically.... 

I will post my code:

<asp:Repeater ID="rptMemberstop" runat="server">
<ItemTemplate>
<section class="airlineLogo">
<a href="<%# ((AirlineMemberPT)Container.DataItem).AirlineLink %>" title="<%# ((AirlineMemberPT)Container.DataItem).PageName %>">
<img class="logoHover" src="<%# ((AirlineMemberPT)Container.DataItem).AirlineLogoActive %>" alt="<%# ((AirlineMemberPT)Container.DataItem).PageName %>" />
<img src="<%# ((AirlineMemberPT)Container.DataItem).AirlineLogo %>" alt="<%# ((AirlineMemberPT)Container.DataItem).PageName %>" />
</a>
</section>
</ItemTemplate>
</asp:Repeater>


CodeBehind:
// Retrieve the page data
rptMemberstop.DataSource = PageUtilities.GetChildren<AirlineMemberPT>(SitewideProperties.AirlineMemberContainer,LanguageSelector.AutoDetect()).Where(m => m.VisibleInMenu).Take(7);
rptMemberstop.DataBind();
 
 And my PageType:
 
using EPiServer.Core;
using EPiServer.SpecializedProperties;
using FilteredPageReference;
using PageTypeBuilder;
using SkyTeam.Business.Cms.PageTypes.Base;

namespace SkyTeam.Business.Cms.PageTypes.Data
{
[PageType( DefaultChildSortOrder = EPiServer.Filters.FilterSortOrder.Index, Name = "[Data] Airline Member",
DefaultVisibleInMenu = true, Description = "Airline Member", Filename = "~/Templates/Empty.aspx", AvailablePageTypes = new[] { typeof(LoyaltyProgramPT), typeof(FrequentFlyerProgramPT) } )]
public class AirlineMemberPT : BaseDataPage
{
/// <summary>
/// Gets or sets AirlineLogo.
/// </summary>
[PageTypeProperty(SortOrder = 1010, UniqueValuePerLanguage = false,
Type = typeof(PropertyImageUrl), EditCaption = "Airline logo", HelpText = "The airline logo in footer")]
public virtual string AirlineLogo
{
get;
set;
}

/// <summary>
/// Gets or sets Active (fullcolor) AirlineLogo.
/// </summary>
[PageTypeProperty(SortOrder = 1020, UniqueValuePerLanguage = false,
Type = typeof(PropertyImageUrl), EditCaption = "Airline logo (active)", HelpText = "The active airline logo in footer")]
public virtual string AirlineLogoActive
{
get;
set;
}

/// <summary>
/// Gets or sets link to Airline content page
/// </summary>
[PageTypeProperty(SortOrder = 1030, UniqueValuePerLanguage = false,
Type = typeof(PropertyUrl), EditCaption = "Link to Airline content page", HelpText = "The link airline logo in footer")]
public virtual string AirlineLink
{
get;
set;
}

/// <summary>
/// Gets or sets the IATA code.
/// </summary>
[PageTypeProperty(SortOrder = 1100, UniqueValuePerLanguage = false, Required = true,
Type = typeof(PropertyString), EditCaption = "IATA code", HelpText = "The IATA code")]
public virtual string Code { get; set; }

/// <summary>
/// Gets or sets the global meeting email.
/// </summary>
[PageTypeProperty(SortOrder = 1101, UniqueValuePerLanguage = false,
Type = typeof(PropertyString), EditCaption = "Global meeting email", HelpText = "The email address used for sending a global meeting proposal")]
public virtual string GlobalMeetingEmail { get; set; }

/// <summary>
/// Gets or sets the global meeting website.
/// </summary>
[PageTypeProperty(SortOrder = 1101, UniqueValuePerLanguage = false,
Type = typeof(PropertyUrl), EditCaption = "Global meeting website", HelpText = "The website url used for global meetings")]
public virtual string GlobalMeetingURL { get; set; }

/// <summary>
/// Gets or sets the references to the shared terminals for this airline.
/// </summary>
[PageTypeProperty(SortOrder = 1110, UniqueValuePerLanguage = true,
Type = typeof(PropertyFilteredLinkCollection), EditCaption = "Shared terminals (Cargo)", HelpText = "The references to the shared terminals for this airline")]
public virtual LinkItemCollection SharedTerminals { get; set; }

}
}
 
 

 

#52563
Aug 03, 2011 10:28
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.