We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24865
    • 289 Posts
    Hi guys,

    Let me say first off, I’m very very new to MODx, so bare with me here.

    I’ve installed Wayfinder and I’ve been playing with the settings for a while, trying to figure out what they do. The example.config.php helped a lot. Now comes the funny bit.
    I reckon, when I set &config=`mycfg`, Wayfinder fetches mycfg.config.php from the config directory on the FTP of Wayfinder. I don’t think it does that for me... Since a config is meant to overwrite some values. Using the &debug=`1` didn’t display any changes I’ve made in my configuration file.

    //edit
    Oh yea, it DID display the configuration file path to my file (I’m using MODx localy, so it kinda messed up backslashes and slashes)

    This is how my config file currently looks:
    <?php
    
    $startId = 0;
    $level = 1;
    $limit = 12;
    $ignoreHidden = true;
    $hideSubMenus = false;
    //$includeDocs = '1,2,3,4,5,6';
    $sortBy = 'menuindex';
    $sortOrder = 'asc';
    $textOfLinks = 'menutitle';
    $titleOfLinks = 'introtext';
    $useWeblinkUrl = false;
    $fullLink = false;
    $removeNewLines = false;
    $hereClass = 'active';
    
    $rowTpl = '<li><a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a>';
    
    $outerTpl = '<ul>[+wf.wrapper+]</ul>';

    Not all that exciting, I know, but still, it doesn’t work. Even just pumping some useless crap into the config file like the all well known favorite: "klkjsadflkjadsflkjasfd" didn’t do anything. Maybe it doesn’t display errors, I don’t know.

    In short, my config file doesn’t do anything for me!

    Oh yea, and a little off topic, I don’t get the startId parameter. Does the ’loop’ of fetching resources start at Id 0 OR does it start as some kind of depth. The only way I could get my items to display was by using &hideSubMenus=`1` and &startId=`0`...

    Thanks a lot.


    ReSpawN

    //edit (again...)
    And of course, the part of my template file you need.
    <div class="menu-center">
    	[[!Wayfinder? &config=`mycfg`]]
    </div>

      @MarkGHErnst

      Developer at Adwise Internetmarketing, the Netherlands.
      • 3749
      • 24,544 Posts
      &config -- if this parameter exists then Wayfinder will interpret the value given as the <name> part of a Wayfinder configuration file, where the full name of the file must be <name>.config.php and the file must be in the directory /assets/snippets/wayfinder/configs/.

      If you specify a file that Wayfinder can’t find, then it will look instead for the default config file: /assets/snippets/wayfinder/configs/default.config.php.

      If Wayfinder can’t find either of these files, then it will ignore the &config parameter.

      More info here: http://www.lucidgreen.net/modxGuides/wayfinder200_docs_v6.html

      Be sure you’re using Wayfinder 2.*
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 4310
        • 2,310 Posts
        Don’t know if it needs it but I always use the format :
        $rowTpl = '@CODE:<li><a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a>';
        
        $outerTpl = '@CODE:<ul>[+wf.wrapper+]</ul>';
          • 24865
          • 289 Posts
          This might be very important, I am using MODx Revolution 2.0.0-rc-2 rev6923 and Wayfinder 2.2.1 RC1

          Hi guys,

          Thanks for the answers. Over the weekend I haven’t found the time to reply so this’ll have to do!

          Bare with me here, because I am new to MODx.

          I’ve created a template file which obviously always displays itself. So, knowning that, that would be the right place to place my Wayfinder - right? Right!
          So, I’ve dragged and dropped the wayfinder without any opties, which works like a charm. The following string was outputted and a little bit modified by me of course:
          [[!Wayfinder? &config=`mep`&debug=`1`]]

          So, I’ve got the config set up as `mep` which is the shortname for my company, but that doesn’t really matter. I’ve got two directories. /assets/snippets/wayfinder/configs/mep.config.php and /core/components/wayfinder/configs/mep.config.php. Both directories are perfectly accesable by MODx and even the DEBUG reports: "Config: C:\wamp\www\modx/core/components/wayfinder/configs/mep.config.php", which proves to me that it crawls the /core/ and subdirs. So, knowing that, I’ve checked the file, which hasn’t changed.
          <?php
          
          $startId = 0;
          $level = 1;
          $limit = 12;
          $ignoreHidden = true;
          $hideSubMenus = false;
          //$includeDocs = 1,2,3,4,5,6 (later pas)
          $sortBy = 'menuindex';
          $sortOrder = 'asc';
          $textOfLinks = 'menutitle';
          $titleOfLinks = 'introtext';
          $useWeblinkUrl = false;
          $fullLink = false;
          $removeNewLines = false;
          $hereClass = 'testtesttest';
          
          $rowTpl = '<li><a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a>';
          
          $outerTpl = '<ul>[+wf.wrapper+]</ul>';


          @bunk58, thanks for the tips, haven’t modified them yet! Then again, what does @CODE: mean? I can’t find that anywhere.

          Back on topic again, you can see that I’ve got a simple "testtesttest" in the $hereClass variable. Now, checking the debug output, it still says "hereClass: active"! So it is very apperent that it doesn’t even bother to read my config. How the hell did that happen? tongue

          Of course, I can enter all code I want into the string in the template resource, but that SHOULD work - why doesn’t it?

          A little side question: why do I need to enter startId=`0` every time?

          Thanks again!

          /edit
          Using WayFinder 2.1.1 RC1
            @MarkGHErnst

            Developer at Adwise Internetmarketing, the Netherlands.
            • 3749
            • 24,544 Posts
            Quote from: ReSpawN at Jun 15, 2010, 03:09 AM

            Bare with me here, because I am new to MODx.

            OK, I’m naked. Now what? (sorry, couldn’t resist)



            @CODE means use the string following @CODE for the value.

            The problem finding your config sounds like a bug.

            I would create a new property set for Wayfinder and use that instead of the config file. It would be a lot faster and easier to maintain, then tell Wayfinder the property set to use like this:

            [[!Wayfinder@MyWayfinderProps]]


              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting
              • 24865
              • 289 Posts
              Yay! My first bug. (good one on the ’bare with me part’ there!)

              Alright, so I am new to MODx but(t) I dont know what a property set is. Obviously, I now know how to use it but where do I create one and how would that look?

              Thanks again for the speedy answer Bob!
                @MarkGHErnst

                Developer at Adwise Internetmarketing, the Netherlands.
                • 3749
                • 24,544 Posts
                Quote from: ReSpawN at Jun 16, 2010, 04:45 AM

                Yay! My first bug. (good one on the ’bare with me part’ there!)

                Alright, so I am new to MODx but(t) I dont know what a property set is. Obviously, I now know how to use it but where do I create one and how would that look?

                Thanks again for the speedy answer Bob!

                You can always create a property set by going to Tools->Property sets and clicking on "New Property Set."

                You can also create them on the Property Sets tab of the Create/Edit element panel when editing a snippet (or other element). This is the preferred method because they are automatically "attached" to the element.

                For snippets, the properties are essentially the same as the parameters in the tag (and the properties in the default properties of the snippet), except that:

                1. properties in a property set override default properties.
                2. properties set as parameters in a tag override both of the above.

                To have the properties in a property set called MyProps available in a snippet (MySnippet), they need to be "attached" which happens automatically if you create them on the snippet’s Properties tab, or manually in Tools->Property sets.

                The set also has to be "specified" in the snippet tag:

                [[MySnippet@MyProps]]


                  Did I help you? Buy me a beer
                  Get my Book: MODX:The Official Guide
                  MODX info for everyone: http://bobsguides.com/modx.html
                  My MODX Extras
                  Bob's Guides is now hosted at A2 MODX Hosting
                  • 18373 ☆ A M B ☆
                  • 3,141 Posts
                  So, I’ve got the config set up as `mep` which is the shortname for my company, but that doesn’t really matter. I’ve got two directories. /assets/snippets/wayfinder/configs/mep.config.php and /core/components/wayfinder/configs/mep.config.php. Both directories are perfectly accesable by MODx and even the DEBUG reports: "Config: C:\wamp\www\modx/core/components/wayfinder/configs/mep.config.php", which proves to me that it crawls the /core/ and subdirs. So, knowing that, I’ve checked the file, which hasn’t changed.

                  Bare with me, but shouldn’t the slashes be the other way? Or like, accessing http://localhost/core/components/....?
                  (I’m an XAMPP guy)
                    Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

                    Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.