We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14368
    • 56 Posts
    Just wondering if output filters are supported in the Revolution version of Wayfinder.

    I’m trying to do this in my rowTpl chunk:

    <li><a id="mu[[+wf.title:lcase]]" href="[[+wf.link]]" title="[[+wf.title]]"><span>[[+wf.title]]</span></a></li>


    but the output is:

    <li><a id="mu" href="index.php?id=5" title="Contact"><span>Contact</span></a></li>


    If not, is there an alternative? Thanks.
      • 14368
      • 56 Posts
      See here: http://modxcms.com/forums/index.php/topic,49911.0.html
      for my attempts at creating a snippet to do the same thing as the filter ...
        • 4172
        • 5,888 Posts
        wayfinder seems still not to use revos chunk-processing:

                /* process the row */
                $output .= str_replace($usePlaceholders,$phArray,$useChunk);
                /* return the row */
          -------------------------------

          you can buy me a beer, if you like MIGX

          http://webcmsolutions.de/migx.html

          Thanks!
          • 14368
          • 56 Posts
          Thanks for the reply Bruno.

          Sorry for being dumb, but I’m not sure what this means for my code ... can I not use filters in WayFinder chunks?
          Do you know of an alternative to use instead?
            • 4172
            • 5,888 Posts
            I’m about to find a possible fix for your issues.

            both of your tasks will not work at this time.
            Not the outputfilter nor your snippet, because of prse-ordering as it is now.

            for your snippet perhaps you can try to change the function fetch in core/components/wayfinder/wayfinder.class.php

            from

            	public function fetch($tpl){
                    $template = "";
                    if ($this->modx->getChunk($tpl) != "") {
                        $template = $this->modx->getChunk($tpl);
                    } else if(substr($tpl, 0, 6) == "@FILE:") {
                        $template = $this->get_file_contents(substr($tpl, 6));
                    } else if(substr($tpl, 0, 6) == "@CODE:") {
                        $template = substr($tpl, 6);
                    } else {
                        $template = false;
                    }
                    return $template;
                }
            


            to

            	public function fetch($tpl){
            		global $modx;
            		$template = "";
            
                    if ($chunk= $modx->getObject('modChunk', array ('name' => $tpl), true)) {
                        $template = $chunk->getContent();
            		} else if(substr($tpl, 0, 6) == "@FILE:") {
            			$template = $this->get_file_contents(substr($tpl, 6));
            		} else if(substr($tpl, 0, 6) == "@CODE:") {
            			$template = substr($tpl, 6);
            		} else if(substr($tpl, 0, 5) == "@FILE") {
            			$template = $this->get_file_contents(trim(substr($tpl, 5)));
            		} else if(substr($tpl, 0, 5) == "@CODE") {
            			$template = trim(substr($tpl, 5));
            		} else {
            			$template = false;
            		}
            			return $template;
            	}
            
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
              • 14368
              • 56 Posts
              Wow, didn’t think what I was trying to do was that unusual. Is WayFinder designed to work so that you shouldn’t be modifying the parameter values? If so then probably just modifying my class name is a better option for me, rather than modifying WayFinder code to hack in this ability (although I definitely appreciate you finding a way around it for me Bruno!).

              Maybe the ability to use output filters on parameter value results is a good idea to include in the next release? Although it if requires major changes to the way it parses everything then it may not be worth it.

              Thanks again for your help Bruno, much appreciated.
                • 4172
                • 5,888 Posts
                wayfinder comes from evolution and this part isn’t converted completly.

                filed that and a possible solution, which seems to work so far on jira:
                http://svn.modxcms.com/jira/browse/WAYFINDER-24
                  -------------------------------

                  you can buy me a beer, if you like MIGX

                  http://webcmsolutions.de/migx.html

                  Thanks!
                  • 22303 MODX Staff
                  • 10,725 Posts
                  FWIW, converting Evolution components like Wayfinder and Ditto was troublesome because of the fundamental changes to the parsing in the Revolution core. These legacy components had to work around the quirky parse ordering of Evolution itself, and maintaining some of the expected behavior is troublesome because of this. IOW, making this work correctly in Revolution may change the behavior folks who have used Wayfinder in Evolution have come to expect, so we’ll just have to work through the best way forward with each issue.

                  Thanks for working through these issues.
                    • 36493
                    • 64 Posts
                    Hi I’m interested inthis fix too,

                    Unfortunately I get an error trying to download the fix from jira any chance some one could send it to me if it’s still working?
                      |
                      • 4172
                      • 5,888 Posts
                      I’ve attached the file. I think that was it, which I had uploaded to jira.
                        -------------------------------

                        you can buy me a beer, if you like MIGX

                        http://webcmsolutions.de/migx.html

                        Thanks!