We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 52974
    • 1 Posts
    The organisation I work for has a website run by MODX 1.0.15
    www.hub4health.org.au
    If you click on the Youth Page (under the services tab)it brings up the main page with YOUTH written in the banner (Pic3. attachment). And an accordion type box down the right hand side.
    My problem is when you click on any of the articles in the accordion box and open them up, the YOUTH title in the banner changes to whatever the title of the article is (Pic4 attachment), and I want it to just stay as YOUTH.
    Is there any way of fixing this that isn't too complicated as I am only learning.
      • 37105
      • 194 Posts
      Hi hub4health,

      This could be done using the extra pdoTools.

      https://docs.modx.pro/en/components/pdotools/quick-start#pdoField

      With this extra some snippets are available such as pdoField.

      [[pdoField?
          &id=`[[*id]]`
          &field=`pagetitle`
          &top=`1`
      ]]


      This code will retrieve the parent of current page.
        Codeplaza Webdesign: for professional websites at low cost
        • 4041
        • 788 Posts
        Once you eventually upgrade to 1.1.0+ you will be able to use the following new features:

        [*pagetitle@17*],
        [*pagetitle@parent*],
        [*pagetitle@ultimateparent*]
        ([*pagetitle@uparent*]),
        [*pagetitle@ultimateparent(17)*],
        [*pagetitle@alias(alias/path)*],
        [*pagetitle@site_start*]

        Until then use the code below to create a new snippet named pagetitle, and replace the [*pagetitle*] call in your template with the snippet call [!pagetitle!].
        <?php
        /* pagetitle snippet
           - snippet call [!pagetitle!]
           - replace [*pagetitle*] in template
           - 
        */
        $default_output ='[*pagetitle*]';
         
        $parent_title ='';
        $parent_title = $modx->getParent( $modx->documentObject['id'], 1, 'pagetitle' );
        
        // if parent title is empty, use default page title
        $output = $parent_title !='' ? $parent_title : $default_output;
        
        return $output;
        ?>
          xforum
          http://frsbuilders.net (under construction) forum for evolution