I have a view method and I want to it to return different content based on the context you're on and this content is stored in /en/module/document
how do I make a query that returns the same selected content based on the current language? The same translated document will also be in /it/moduli/documento
. I know how to query based on the location of the cotnent but that would be hardcoding it for every language.
def getModuleContent(self):
if self.context == "projects":
document1 = api.content.find(portal_type='Document', context=?) #document1, return based on current language
if self.context == "home":
document2 = api.content.find(portal_type='Document', context=?) #document2, return based on current languag
<div class="moduleLink">
<tal:block tal:define="module view/getModuleContent">
</tal:block>
</div>