We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33070
    • 57 Posts
    hi am building website where i need featured section on home page only, featured section hav three section i tried using this way
    <?php
    if($modx->documentIdentifier == '1'){
    [!Ditto? &parents=`3`&orderBy=`createdon ASC` &display=`1` &tpl=`testimonial_summary`!]
    [!Ditto? &parents=`3`&orderBy=`createdon ASC` &display=`1` &tpl=`highlighted_project`!]
    [!Ditto? &parents=`3`&orderBy=`createdon ASC` &display=`1` &tpl=`news_summary`!]
    }
    ?>


    its not working sad getting this error
    Parse error: parse error in C:\wamp\www\modx10\manager\includes\document.parser.class.inc.php(770) : eval()'d code on line 3
    
    yes parent will be different with all ditto call please help me
      • 26931
      • 2,314 Posts
      anonymized-26931 Reply #2, 17 years ago
      Hi yasirhaleem,

      you probably need to run the snippet via the MODx API -> http://wiki.modxcms.com/index.php/API:runSnippet
        • 33070
        • 57 Posts
        Quote from: sharkbait at Oct 05, 2009, 06:54 AM

        Hi yasirhaleem,

        you probably need to run the snippet via the MODx API -> http://wiki.modxcms.com/index.php/API:runSnippet

        Hello sharkbait

        thank you very much for the quick response i follow the above link but could’t get the result and i think this way i have to create multiple snippets i tried different way i replaced the "ditto" with ditto did’t work than i created snippet and call within quotes but still could’t get it working and how i will print output ?
        i am using below code
        <?php
        if($modx->documentIdentifier == '1'){
        $testimonialOutput=$modx->runSnippet(
                "news_summary",
                array(
                    "tpl" => "<post><title>[+title+]</title><summary>[+summary+]</summary></post>"
                )
        );
        echo $testimonialOutput."snippet";
        
        }
        ?>
          • 4172
          • 5,888 Posts
          I think, I would create a textarea-TV ’extrasection’ then in your template on the right place add [*extrasection*] and fill this TV on page 1 with your Ditto-calls.

            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 26931
            • 2,314 Posts
            anonymized-26931 Reply #5, 17 years ago
            I think, I would create a textarea-TV ’extrasection’ then in your template on the right place add [*extrasection*] and fill this TV on page 1 with your Ditto-calls.
            hahaaa - why going the easy way, when you can make it complicated grin ...i need to read posts more carefully