We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11668
    • 14 Posts
    Does anybody know of a way to let the browser title bar display the "folder / sub folder / doc title" path?
    The existing
    <title>[(site_name)]  | [*pagetitle*]</title>
    eliminates any folder/page in between.

    Cheers
      Hakim
      • 11668
      • 14 Posts
      Thanks, but for some reason I can only get the subfolder to display by id number (not its alias) i.e. :
      ’My Site’ / ’54’ / ’Page’

      Another option I came across, was getting it to display the full url in the browser bar e.g. :
      ’http://www.mysite.com/subfolder/page/’ which looks downright nasty.

      What I’m after is:
      ’My Site’ / ’Folder’ / ’Page’

      Any suggestions? I might have missed out something in the Breadcrumbs 0.9f

      Ta,
        Hakim
        • 33372
        • 1,611 Posts
        Well, you can certainly do this with the Breadcrumbs snippet (or some minor variation of it). But if all you need is one folder deep, you can also just get the pagetitle of the current document’s parent and use that in the title bar (as long as it’s not the site root). If you need to go multiple levels deep, then you’d just need to keep getting the parent of each parent until you get to the site root.
          "Things are not what they appear to be; nor are they otherwise." - Buddha

          "Well, gee, Buddha - that wasn&#39;t very helpful..." - ZAP

          Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
          • 11668
          • 14 Posts
          Thanks, this solution did cross my mind, problem is that the default page for the subfolder isn’t the first child, hence I end up with ex: ’mysite / clients / clients’
            Hakim
            • 33372
            • 1,611 Posts
            So you only want to display the parent’s title when the parent is not the site root (e.g., mysite/clients, mysite/clients/whatever)?
              "Things are not what they appear to be; nor are they otherwise." - Buddha

              "Well, gee, Buddha - that wasn&#39;t very helpful..." - ZAP

              Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
              • 11668
              • 14 Posts
              That’s about it. To illustrate lets say site has 4 main links like:

              ’home’ ’about’ ’casestudies’ ’contact’

              browser title should be: ’My Site Name’ / ’Home’ when on ’Home’, ’My Site Name’ / ’About’ when on ’About’ - and so on..

              Now, ’casestudies’ has a landing page and a list of links to several cases sitting below this section.

              The default landing page doesn’t include any particular casestudy itself, hence the title bar should display:
              ’My Site Name’ / ’Casestudies’.

              When navigating to one of the underlying pages, title bar needs display:
              ’My Site Name’ / ’Casestudies’ / ’Case name’

                Hakim
                • 33372
                • 1,611 Posts
                OK so it sounds as if you just need "Casestudies /" inserted into the title when you’re viewing a case study page. You could do that easily just by using a different template for those pages, or by having a TV that you use to insert that (or any other text) into the title bar of a page. Or you could use a simple snippet like:

                <?php
                $csID=2; // document id of case study container
                $output='';
                $parent=$modx->getParent($modx->documentIdentifier,1,'id,pagetitle');
                if ($parent['id']==$csID) $output=$parent['pagetitle'].' / ';
                return $output;
                ?>


                This would display the pagetitle of only the casestudy container document, so you could put in in your regular template and it wouldn’t show anything for pages that are not children of that container. Alternatively you could modify this snippet to always show any container’s pagetitle (or alias, or whatever you like) except for specific containers that you exclude (such as the site root). In MODx there are always a dozen ways to skin a cat (stay away from my kitty, however).
                  "Things are not what they appear to be; nor are they otherwise." - Buddha

                  "Well, gee, Buddha - that wasn&#39;t very helpful..." - ZAP

                  Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
                  • 11668
                  • 14 Posts
                  Cheers for that ZAP,

                  I think the snippet solution might be worth a try. I’m not too crazy about the idea of adding extra templates. I already have two different templates in use, as I don’t want an empty div tag in my markup on the pages where wayfinder isn’t displaying level 2 nav. - am I fuzzy or what? wink
                    Hakim
                    • 33372
                    • 1,611 Posts
                    No reason to add a new template if you don’t need it (it’s just more places you might need to make changes later).
                      "Things are not what they appear to be; nor are they otherwise." - Buddha

                      "Well, gee, Buddha - that wasn&#39;t very helpful..." - ZAP

                      Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options