We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12342
    • 12 Posts
    Something weird is happening with Modx 1.0.3. Any help would be appreciated.
    For some reason the [*id*] which has a value of "8" yet, when i do a var_dump, it comes out as a string(6) but it should be string(1).


    here is my snippet call from chunk:
    [[rightContent? &quote=`[*pageQuote*]` &aboutImg=`[*aboutImg*]` &currentid=`[*id*]` ]]

    the snippet rightContent get currentid:
    $arr = array("currentid"=>$currentid);

    then calls another snippet
    $modx->runSnippet(’recentArticles’,$arr);

    on the snippet recentArticles i compare currentid to the pageid and it fails.
    var_dump($currentid); //OUTPUTS = string(6) "8"
    var_dump($pageID); // OUTPUTS = string(1) "8"

    Any Clues???
    • In Evolution (this is not true in Revolution), Snippets get processed after the content fields or template variables. This means the snippet is receiving the actual text [*id*], which is a string(6). You’ll have to aither call the snippet uncached (so the content fields/template variables are parsed before the snippet is), or you’ll need to find another way to pass the data to the snippet.
        • 12342
        • 12 Posts
        Thank you so much...
        Calling the snippet the uncached way did it.