We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25910
    • 26 Posts
    Hi,

    I have three contexts and would like to display in a template the content of a specific resource according the context. I tried to do the following:

    [!getResources? &resources=`714,715,716`
    &tpl=`mytpl`
    &includeContent=`true`
    ]]

    where 714 = resource in french, 715 = resource in german and 716 = resource in english

    My problem: the getResources 1.2.2-pl displays all the three resources in each context. I want to display only the resource of the current context. I made a test with the &context parameter, thought displaying only the german resource:

    &context=`de`

    but nothing happened. How can I solve this? Or can someone propose me another approach?

    Thanks,
    S.
      • 13166
      • 24 Posts
      I had the same problem and solved it with an lexicon entry. I have created a lexicon for language specific items. There I added an entry with name "idNewsParent" and entered the IDs of the parent documents. Finally I call the lexicon entry in the snippet call:
      [[getResources? &parents=`[[%idNewsParent? namespace=`nameofyournamespace`]]` &tpl=`tplGetNews` &includeContent=`1` &where=`{"template:=":3}` showHidden=`1`]]