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

    I have a snippet that’s getting the name of the parent document (if there is a child). It worked like a charm till I tried to make it multilingual. Since this Parent snippet itself uses [*ID*] to get title, It seems I can’t use YAMS data call..

    Original "ParentName" snippet code:

    <?php
    $parent = $modx->getParent($pageId,1,’pagetitle’);

    $parentName = $parent[’pagetitle’];
    $currentTitle = $modx->documentObject[’pagetitle’];

    if ($parentName != ""){
    return $parent[’pagetitle’];
    }else{
    return $currentTitle;
    }
    ?>


    and a snippet call:

    [!ParentName? &pageId=`[*id*]`!]


    I know I could use just [[YAMS? &get=`data` &from=`pagetitle` &docid=`[*id*]`]] to get multilingual title, but I really need to get this parent thing to work.
    It would be so nice if someone could help me with this one..

    Thanks in advance,
    Roman



      • 15083
      • 697 Posts
      Whats happening with that call? it looks ok.