Kentico - Restrict Related Pages to Localized Pages as it were

Adam Geary asked on October 8, 2021 11:04

I have a multilingual site and utilize the Related Pages usefulness to a great extent. What I've seen is that connected pages are not limited, which means in the event that I add a connected page for the U.S. site, that page will be identified with the U.K. site also. Also, that is not what I need.

Is there an approach to limit Related Pages to just pages that are accessible in the current culture?

walgreenslistens

Recent Answers


Juraj Ondrus answered on October 8, 2021 13:59

The related pages are using NodeIDs (check the CMS_RelationShip table - LeftNodeID, RightNodeID)- this means the data from CMS_Tree table, which is not culture dependent. This means, related pages do not support multilingual setup. They were designed before multilingual support was added. But don't worry, there is a way! You can use the UniSelector form control instead (general UniSelector documentation). And you will configure the selector to work with cms.document page type and set the condition to use current language based on the culture code. Sample screen shot - the WHERE condition is like:
DocumentCulture = '{%EditedObject.DocumentCulture#%}'

And then it could look like in these screen shots:
EN culture
Spanish culture

Hope it helps.

1 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.