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

    I’m trying to call a chunk with placeholder.

    It’s working only for classic placeholder, not for test with PHX.
    Example :
    $modx->setPlaceholder('id', $row["id"]);
    $modx->setPlaceholder('pagetitle', $row["pagetitle"]);
    $modx->setPlaceholder('description', $row["description"]);
    $modx->setPlaceholder('introtext', $row["introtext"]);
    $resultat.= $modx->getChunk('mytpl');

    And mytpl :
     <div class="texte">
                <td class="titre">
                  <h2><a href="/[~[+id+]~]" title="[+longtitle+]">[+pagetitle+]</a></h2>
                <td class="description">
                  [+phx:if=`[+description+]`:is=``:then=``:else=`<a href="/[~[+id+]~]" title="[+longtitle+]">[+description+]</a>`+]
                  <a href="/[~[+id+]~]" title="[+longtitle+]">[+introtext+]</a></p>
                  <p class="date"><a href="/[~[+id+]~]">[[afficheDate? &id=`[+id+]`]]</a></p>

    The PHX is not executed ...

    Do you have any idea this problem ?

    Thanks for helping