We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9053
    • 18 Posts
    Thanks for response guys!

    @davidm: I have (well, will have indeed smiley ) a shared server, so site shouldn’t produce so many requests.
    @garryn: I need smth like this in Ditto news block:

    --
    Heading
    Summary
    "This article is placed in:" link on article parent
    --

    I’ve tried functions you suggested, it seems that we still need in some DB requests to get parent pagetitle (it is not equal to document alias in my case). I’m bad with PHP programming, so I tried to modify Breadcrumbs snipett. It was relatively simple (but take about an hour for me to made it smiley ). So:

    We need to pass through 3 steps to get smth like this in our ditto block:

    --
    Heading
    Summary
    "This article is placed in:" link on article "ultimate" parent > link on article "subultimate" parent > ... > link on article "direct" parent
    --

    1. Open Breadcrumbs snippet and add string:
    (isset($docid)) ? $docid : $docid = $modx->documentIdentifier;
    in "Configuration Settings" section.

    2. Modify string:
    $docInfo = $modx->getDocument($modx->documentIdentifier,'id,pagetitle,menutitle,published,deleted,parent,hidemenu,description,longtitle,introtext');

    to:
    $docInfo = $modx->getDocument($docid,'id,pagetitle,menutitle,published,deleted,parent,hidemenu,description,longtitle,introtext');


    3. Call Breadcrumbs snippet inside your Ditto template with
    &docid=`[+id+]`.


    You probably also add
    &showCrumbsAtHome=`1`,  &showCurrentCrumb=`0`,  &showHomeCrumb=`0`
    in order for breadcrumbs showing nicely. # of requests decreased significally, from 152 to 75 (still need some work on it, i think).

    Hope it will help someone.
      "Sorry for my english"