Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

FindPagesWithCriteria returning no results when LanguageSelector specified.



We have a multi lingual site (English and Arabic). We are using  FindPagesWithCriteria to return a filtered list of pages. The original code,

 PropertyCriteriaCollection criterias = DataFactory.Instance.FindPagesWithCriteria(this.ListingRootPage, criterias, AccessLevel.NoAccess)

returned all the correct results for english, however, does not seam to return results for arabic.

I thought this might be a language issue, especially as there where pages that didn't have arabic content. I tried to modify it to this:

  PropertyCriteriaCollection criterias = DataFactory.Instance.FindPagesWithCriteria(this.ListingRootPage, criterias,lang.LanguageID, LanguageSelector.Fallback(lang.LanguageID, false), AccessLevel.NoAccess)

This code returns no results for english or arabic.

Any ideas as to why this is causing an issue? I cannot see why this would not work?




Aug 07, 2008 13:27

Ok, Found a work around.

 Couldn't get FindPagesWithCriteriato work specifying the language Id, so instead I added the PageLanguageID as a criteria.

PropertyCriteria criteria = new PropertyCriteria();
criteria.Name = "PageLanguageID";
criteria.Condition = EPiServer.Filters.CompareCondition.Equal;
criteria.Type = PropertyDataType.String;
criteria.Value = this.CurrentPage.LanguageID;
criteria.Required = true;


This seams to work fine.




Aug 11, 2008 11:07
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.