We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26325
    • 36 Posts
    Trying out WayFinder and so far so good except for one thing I can’t figure out yet. (I’m using MODx 0.9.2.1 rev 1005 and the WF beta 2.)

    For SEO reasons, when on any site sub page I want the home page menu item to only link to my root URL (http://www.domain.com/) with no other filepath info (such as http://www.domain.com/index.html). I played with the suffix and alias name in the furl settings but that hasn’t resolved it. I still end up with www.domain.com/something. I’m sure it can be done but I’m obviously going about it the wrong way. Being the SEO friendly CMS, this is an important feature for anyone concerned about their SEO.

    Any input or guidance is appreciated.

    ..Paul
      Visit MODx.mobi to read these forums on mobile devices.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Friendly Alias Paths = no in the site configuration should do the trick.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 26325
        • 36 Posts
        Quote from: sottwell at Sep 02, 2006, 02:54 AM

        Friendly Alias Paths = no in the site configuration should do the trick.
        Hi Susan, I’m pretty sure I tried that but no harm trying it again just in case...(pause)... Sure enough, it still doesn’t work as I hope.

        My FURL settings are as follows:
        Use friendly URLs - Yes
        Prefix - (blank)
        Suffix - (blank)
        Use friendly aliases - Yes
        Use friendly alias path - No
        Allow duplicates - No
        Auto Generate - No

        Home page Alias - (blank)

        URL result when click the Home menu from Blog page - "http://www.mydomain.com/1" (1 corresponds to the document # and is the same result as when I turn off friendly aliases altogether. I’m guessing MODx defaults to the doc # if page alias is blank, which seems like a good thing)

        I also tried entering a single space in the Home page alias field but the URL result is "http://www.mydomain.com/_" (which seems like a good filter built into MODx since a blank space in a URL would be a bad thing.)

        The goal is to press the home menu and get the result "http://www.mydomain.com/". Using the FURLs controls, I would need some charcter string I can enter into the page alias field that will result in a blank space after the domain, or I need to mess with WayFinder somehow (which was why I posted here since I exhausted the available FURLs options I could think of).

        If the menu item was an absolute URL back to the root directory I think it would solve it but I haven’t figured out how to do that yet. sad Since I only want to do this to the home page I’m not defeating the whole point of having a CMS, just trying to keep the SEO clean (which I’ll gladly explain if someone is interested).

        ..Paul
          Visit MODx.mobi to read these forums on mobile devices.
          • 26325
          • 36 Posts
          Now I’m wondering if I should look to an .htaccess rewrite to make this happen, or will doing this now mess up the FURL’s rewrite? I’m going to give it a try but any thoughts would be appreciated.

          ..Paul
            Visit MODx.mobi to read these forums on mobile devices.
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            Ah, sorry, I misunderstood.

            You might be able to hack the Wayfinder snippet to deal with the case when the document ID is the same as the site_start ID, setting the URL directly instead of using the makeUrl function for that item.

            Line 77 in the Wayfinder.inc.php file would be the place to do it. If the $v[’id’] is the same as $modx->config[’site_start’], instead of calling $modx->makeUrl, set $v[’link’] to whatever you want, either hard-code the URL or use site_url or something.
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
              • 26325
              • 36 Posts
              Quote from: sottwell at Sep 03, 2006, 02:22 AM

              Ah, sorry, I misunderstood.

              You might be able to hack the Wayfinder snippet to deal with the case when the document ID is the same as the site_start ID, setting the URL directly instead of using the makeUrl function for that item.

              Line 77 in the Wayfinder.inc.php file would be the place to do it. If the $v[’id’] is the same as $modx->config[’site_start’], instead of calling $modx->makeUrl, set $v[’link’] to whatever you want, either hard-code the URL or use site_url or something.
              Hi Susan,
              I am going to explore your suggestions next, but I did accomplish it using the htaccess file as follows (assumes the homepage alias is called "home" and the FURL’s prefix and suffix are both blank):

              # Rewrite directives here for SEF (Search Engine Friendly) URLs
              
              RewriteEngine on
              RewriteBase /
              
              # .............THESE NEXT TWO LINES ARE ADDED TO THE "REGULAR" FURLS HTACCESS CODE
              
              RewriteCond %{THE_REQUEST} ^.*\/home
              RewriteRule ^(.*)home$ http://www.mydomain.com/$1 [R=301,L]
              
              RewriteCond %{REQUEST_FILENAME} !-f
              RewriteCond %{REQUEST_FILENAME} !-d
              
              RewriteRule ^(.*)$ /index.php?q=$1 [L,QSA]
              

              newbie disclaimer: shocked This solution may completely suck for reasons beyond my limited knowledge, so use this at your own risk! If this idea is horrible, somebody please set me straight. Now I’m off to study the WayFinder code to better understand your suggestions. Thanks Susan!

              ..Paul
                Visit MODx.mobi to read these forums on mobile devices.
                • 8439
                • 89 Posts
                Another "Is this how I do it" request. Pointers to example code gratefully received.

                I have a 3 column design with main navigation menu in the leftmost column, 1 entry per section, it is required that the current section be highlighted.

                We use CSS classes .nav and .navcurrent for menu entries and to highlight the current row, I think I do this by calling [[Wayfinder? ... &hereClass=’navcurrent’ &rowClass=’nav’]]. Correct?

                On some pages (legal etc) it is required to have no highlighting, these pages have a &rowClass but no &hereClass. Correct?

                Some sections have subsections. The subsection navigation menu, if present, appears in the middle column (and hence in a separate div) and it is required that the current subsection and current section be highlighted. We use CSS classes .subnav and .subnavcurrent for these. Do I just call wayfinder a second time but use [[Wayfinder? ... &hereClass=’subnavcurrent’ &rowClass=’subnav’]] and with hereClass set in the main navigation?

                Is this the wayfinder way to do things?

                This may be off-topic but is there a way to avoid an explosion of templates? If all pages have a common template but the subsections have different parents then I can’t see how to avoid having a new template for each subsection with the appropriate parent hereClass set by hand.

                Ed

                  • 17883
                  • 1,039 Posts
                  Perhaps it would be possible (for Kyle) to add a &startlevel parameter to the snippet...? So you could set one call above the middle column with &startlevel=2 (for example) and if the visitor is in the first level, nothing appears... That would improve lots of menus with changing parents imho. Of course it would be possible to make that via CSS, but for accessibility reasons there shouldn´t always all links be shown. Just thinking...
                    • 15987
                    • 786 Posts
                    Quote from: ed at Sep 05, 2006, 05:18 AM

                    We use CSS classes .nav and .navcurrent for menu entries and to highlight the current row, I think I do this by calling [[Wayfinder? ... &hereClass=’navcurrent’ &rowClass=’nav’]]. Correct?

                    That is correct

                    Quote from: ed at Sep 05, 2006, 05:18 AM

                    On some pages (legal etc) it is required to have no highlighting, these pages have a &rowClass but no &hereClass. Correct?

                    That is correct

                    Quote from: ed at Sep 05, 2006, 05:18 AM

                    Some sections have subsections. The subsection navigation menu, if present, appears in the middle column (and hence in a separate div) and it is required that the current subsection and current section be highlighted. We use CSS classes .subnav and .subnavcurrent for these. Do I just call wayfinder a second time but use [[Wayfinder? ... &hereClass=’subnavcurrent’ &rowClass=’subnav’]] and with hereClass set in the main navigation?

                    Yes, call wayfinder again using your new classes.

                    Quote from: ed at Sep 05, 2006, 05:18 AM

                    This may be off-topic but is there a way to avoid an explosion of templates? If all pages have a common template but the subsections have different parents then I can’t see how to avoid having a new template for each subsection with the appropriate parent hereClass set by hand.

                    You can use the ultimate parent snippet nested inside of your wayfinder call to get a dynamic startId. Here is a link to the snippet: http://www.modxcms.com/UltimateParent-643.html
                      • 20765
                      • 90 Posts
                      myfriendscallmebill Reply #110, 20 years ago
                      I’m building a website that uses Wayfinder extensively. It also has two groups ("Developers" and "Authors") defined in the MODx Manager category, and two groups ("Registered" and "Customers") defined in the web user category.

                      I’m finding that Wayfinder, at least in one case, lists items that should be accessible only to Developers and Authors, along with those that are public. I thought it should only list public documents?

                      Could this be a bug?

                      This discussion is closed to further replies. Keep calm and carry on.