We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8684
    • 29 Posts
    Hi,
    i tried to include this in my call
    &outerTpl=`<ul id="[+wf.classnames+]" class="[+wf.classnames+]">[+wf.wrapper+]  </ul>`


    but does’nt seem to work....
      • 22303 MODX Staff
      • 10,725 Posts
      No, you can’t use ? & or = in MODx tags.
        • 8684
        • 29 Posts
        is there no way, do you see what I want to do?
        for instance instead of creating a new chunks with template code inside and refer to it in a wayfinder call:

        [[Wayfinder? &startId=`123` &level=`1` &outerTpl=`new_chunk_name`]]


        i would like to do something like this, type the code directly instead of having to create a chunk and type the name of this chunks

        [[Wayfinder? &startId=`123` &level=`1` &outerTpl=`<ul id="[+wf.classnames+]" class="[+wf.classnames+]">[+wf.wrapper+]  </ul>`]]


        so, i don’t have to create chunks in the modx ressource manager
          • 8684
          • 29 Posts
          I kept searching
          and i found i can use
          @CODE:

          but it still doesn’t work

          my code:
          [[Wayfinder? &startId=`123` &level=`1` &outerTpl=`@CODE:<ul id="[+wf.classnames+]" class="[+wf.classnames+]">[+wf.wrapper+] </ul>`]]
            • 22303 MODX Staff
            • 10,725 Posts
            WTF is @CODE? Never heard of it.

            And no, you still can’t use HTML as the value of a snippet parameter. You would have to encode every ?, &, and = sign with alternative characters of some type that the snippet would be able to translate back; just like URL encoding. Think of snippet parameters as similar to URL query strings, which also require encoding certain characters.
              • 8684
              • 29 Posts
              ok,
              I found it in the wayfinder class file (wayfinder.inc.php)

              here the function wf uses to fetch tpl:

              function fetch($tpl){
              	
              		// based on version by Doze at http://modxcms.com/forums/index.php/topic,5344.msg41096.html#msg41096
              		global $modx;
              		$template = "";
              		if ($modx->getChunk($tpl) != "") {
              			$template = $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;
              		}echo $tpl;
              		return $template;
              	}
                • 8684
                • 29 Posts
                well, if i can’t do that
                maybe
                can i use putchunk or getchunk to create or modify a chunk without having to go to the manager?

                I know that getchunk retrieves the code of the chunk

                but what is putchunk?