We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22851
    • 805 Posts
    Quote from: towerofbabel at Aug 23, 2009, 01:13 PM

    So, I turned to the YAMS docs and see I am supposed to add this to all Wayfinder calls:

    &rowTpl=`@FILE:assets/modules/yams/tpl/wayfinder/mode/row.tpl` &parentRowHereTpl=`@FILE:assets/modules/yams/tpl/wayfinder/mode/parentrowhere.tpl` &parentRowTpl=`@FILE:assets/modules/yams/tpl/wayfinder/mode/parentrow.tpl` &hereTpl=`@FILE:assets/modules/yams/tpl/wayfinder/mode/here.tpl` &innerRowTpl=`@FILE:assets/modules/yams/tpl/wayfinder/mode/innerrow.tpl` &innerHereTpl=`@FILE:assets/modules/yams/tpl/wayfinder/mode/innerhere.tpl` &activeParentRowTpl=`@FILE:assets/modules/yams/tpl/wayfinder/mode/activeparentrow.tpl` &categoryFoldersTpl=`@FILE:assets/modules/yams/tpl/wayfinder/mode/categoryfolders.tpl` &startItemTpl=`@FILE:assets/modules/yams/tpl/wayfinder/mode/startitem.tpl`


    Do I really need all that? I only use &rowTpl in my calls. I guess I have to customize your &rowTpl=`@FILE:assets/modules/yams/tpl/wayfinder/mode/row.tpl so that it matches my own rowTpl.

    Unless otherwise overridden by specifying a &...Tpl parameter, Wayfinder uses default templates described in the Wayfinder documentation. However, these will not output the content in the correct language. The extra parameters above override the default templates with YAMS compatible ones, which replicate the default templates but display the output in the correct language.

    So, the answer to your question is that (to be on the safe side) you need to use all of the YAMS Wayfinder templates apart from &rowTpl. For &rowTpl you will need to convert your existing &rowTpl template to be YAMS compatible and use that instead. You can take a look at the YAMS &rowTpl file and copy how it is done. (Note that in the parameter list above /mode/ needs to be replaced by either /doc/ or /docr/. Use /docr/ if you would like weblinks resolved.)
      YAMS: Yet Another Multilingual Solution for MODx
      YAMS Forums | Latest: YAMS 1.1.9 | YAMS Documentation
      Please consider donating if you appreciate the time and effort spent developing and supporting YAMS.
      • 22851
      • 805 Posts
      Quote from: Mikhail at Aug 23, 2009, 01:16 PM

      I see that in YAMS-Configuration-Server Config use rules with symbol $ :

      RewriteCond ${REQUEST_FILENAME} !-f
      RewriteCond ${REQUEST_FILENAME} !-d


      But it’s not work. I fix it - changed to %:
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d


      Well spotted. It’s a bug in the server config output by YAMS. I have fixed it. The fix will appear in a bug fix release coming very soon. (Today or tomorrow probably.)

      Quote from: Mikhail at Aug 23, 2009, 01:16 PM

      And another question.
      [[YAMS? &get=`text` &from=`ru::от "первого "лица"`]]

      In example page show only - ’от "первого ’. I think YAMS don’t recognize entity.

      That’s almost certainly a MODx restriction on snippet parameters. MODx probably thinks that the & of " is the start of a new parameter and ignores the rest when it can’t understand it.

      One way to overcome this is to create one chunk called {{mytext_ru}} with the contents от "первого "лица" and similar chunks for your other languages. Then use
      [[YAMS? &get=`chunk` &from=`mytext`]]

      instead.
        YAMS: Yet Another Multilingual Solution for MODx
        YAMS Forums | Latest: YAMS 1.1.9 | YAMS Documentation
        Please consider donating if you appreciate the time and effort spent developing and supporting YAMS.
        • 19149
        • 8 Posts
        Thank You!
          • 30497
          • 245 Posts
          Ok,

          I am not sure if this is a bug or user error. I updated my Wayfinder call:

          <!--[!Wayfinder?&startId=`0`&includeDocs=`1,4,5,6,7,8,9,10`&rowTpl=`menuTpl`!]-->
          
          
          [!Wayfinder?&startId=`0`&includeDocs=`1,4,5,6,7,8,9,10`&rowTpl=`menuTplYAMS` &parentRowHereTpl=`@FILE:assets/modules/yams/tpl/wayfinder/doc/parentrowhere.tpl` &parentRowTpl=`@FILE:assets/modules/yams/tpl/wayfinder/doc/parentrow.tpl` &hereTpl=`@FILE:assets/modules/yams/tpl/wayfinder/doc/here.tpl` &innerRowTpl=`@FILE:assets/modules/yams/tpl/wayfinder/doc/innerrow.tpl` &innerHereTpl=`@FILE:assets/modules/yams/tpl/wayfinder/doc/innerhere.tpl` &activeParentRowTpl=`@FILE:assets/modules/yams/tpl/wayfinder/doc/activeparentrow.tpl` &categoryFoldersTpl=`@FILE:assets/modules/yams/tpl/wayfinder/doc/categoryfolders.tpl` &startItemTpl=`@FILE:assets/modules/yams/tpl/wayfinder/doc/startitem.tpl`!]


          (commented code is the original call pre YAMS)

          My original rowTpl was:
          <li [+wf.classes+]><a id="menu[+wf.docid+]" href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a></li>


          and my new YAMS-ified one is:
          <li [+wf.classes+]><a id="menu[+wf.docid+]" href="(yams_doc:[+wf.docid+])" title="[[YAMS? &get=`content` &docid=`[+wf.docid+]` &from=`pagetitle`]]">[[YAMS? &get=`content` &docid=`[+wf.docid+]` &from=`pagetitle`]]</a></li>


          Everything seems to work ok except the active menu element. It always is output like this:

          <li class="active">
            <span></span>
          
            
          </li>
          


          What do you think could be causing this?



            • 22851
            • 805 Posts
            Quote from: towerofbabel at Aug 23, 2009, 02:52 PM

            Everything seems to work ok except the active menu element. It always is output like this:

            <li class="active">
              <span></span>
            
              
            </li>
            


            What do you think could be causing this?
            I honestly don’t know. This code is being generated using the hereTpl or the innerHereTpl - but I have checked the YAMS templates and they look fine - and your snippet parameters look fine too - so I am stumped for the moment. I have also never had this problem before. Is there any other reason why there would be no content for the active documents? Could the menutitle be empty (this is what the YAMS template puts in the span by default), or is the document unpublished or something like that?
              YAMS: Yet Another Multilingual Solution for MODx
              YAMS Forums | Latest: YAMS 1.1.9 | YAMS Documentation
              Please consider donating if you appreciate the time and effort spent developing and supporting YAMS.
              • 30497
              • 245 Posts
              Quote from: PMS at Aug 23, 2009, 03:35 PM

              Quote from: towerofbabel at Aug 23, 2009, 02:52 PM

              Everything seems to work ok except the active menu element. It always is output like this:

              <li class="active">
                <span></span>
              
                
              </li>
              


              What do you think could be causing this?
              I honestly don’t know. This code is being generated using the hereTpl or the innerHereTpl - but I have checked the YAMS templates and they look fine - and your snippet parameters look fine too - so I am stumped for the moment. I have also never had this problem before. Is there any other reason why there would be no content for the active documents? Could the menutitle be empty (this is what the YAMS template puts in the span by default), or is the document unpublished or something like that?

              All the navigational elements are published. Only the active document (class="active" from Wayfinder) doesn’t show. Meaning, the exact same document’s nav element shows when it is not active.

              It shouldn’t be related to menu title - I am actually loading images here anyway.

              You can see the main menu here:
              http://www.quitsmokingin10days.com/product
              http://www.quitsmokingin10days.com/blog

              and note that when each page given above is not active, the nav item for it still works.

              I am stumped here. Obviously this works with my pre-YAMS Wayfinder call.
                • 22851
                • 805 Posts
                Quote from: towerofbabel at Aug 23, 2009, 03:52 PM

                You can see the main menu here:
                http://www.quitsmokingin10days.com/product
                http://www.quitsmokingin10days.com/blog

                and note that when each page given above is not active, the nav item for it still works.

                I am stumped here. Obviously this works with my pre-YAMS Wayfinder call.
                Well, I can see that the Yamsified bit of the active template is working fine. The <span>...</span> is getting filled in correctly. However, nothing is being output for the standard Wayfinder placeholder, [+wf.wrapper+], with which YAMS does not interfere. I don’t know why that is. Are you really expecting a sub-list of documents to appear here? Could it be that your fairly restrictive list of docs
                &includeDocs=`1,4,5,6,7,8,9,10`
                is excluding the ones you expect to appear there or something like that?

                In the next half an hour I’ll be releasing a bug fix version of YAMS. You could try that and see if it helps - but I can’t see it affecting your Wayfinder problem I’m afraid.

                EDIT: Were you expecting a link instead of a span to be displayed for the active document by the way - or is it simply that you were expecting a sub-list of documents?
                  YAMS: Yet Another Multilingual Solution for MODx
                  YAMS Forums | Latest: YAMS 1.1.9 | YAMS Documentation
                  Please consider donating if you appreciate the time and effort spent developing and supporting YAMS.
                  • 22851
                  • 805 Posts
                  Okay. So YAMS 1.1.3 alpha is available for download from my server. This contains several important bug fixes and some minor improvements, like the possibility to use PHx on multilingual document variables. Note that YAMS wasn’t generating URLs that take into account friendly alias suffixes and prefixes before. It is now.

                  I’ve still got quite a few issues remaining to investigate and deal with on my list. One of them that I am half way through fixing relates to performance with ditto and Wayfinder calls that generate a lot of output. Note that each [[YAMS &get=`content` ...]] will generate as many sql queries as there are languages, which, if you have several snippet calls per document and hundreds of documents, can mean thousands of SQL queries - which is very inefficient and can be very slow. I hope to be able to reduce all this to just a few sql queries.
                    YAMS: Yet Another Multilingual Solution for MODx
                    YAMS Forums | Latest: YAMS 1.1.9 | YAMS Documentation
                    Please consider donating if you appreciate the time and effort spent developing and supporting YAMS.
                    • 30497
                    • 245 Posts
                    Quote from: PMS at Aug 23, 2009, 04:21 PM

                    Well, I can see that the Yamsified bit of the active template is working fine. The <span>...</span> is getting filled in correctly. However, nothing is being output for the standard Wayfinder placeholder, [+wf.wrapper+], with which YAMS does not interfere. I don’t know why that is. Are you really expecting a sub-list of documents to appear here? Could it be that your fairly restrictive list of docs
                    &includeDocs=`1,4,5,6,7,8,9,10`
                    is excluding the ones you expect to appear there or something like that?

                    ...

                    EDIT: Were you expecting a link instead of a span to be displayed for the active document by the way - or is it simply that you were expecting a sub-list of documents?

                    I am not using [+wf.wrapper+], neither in my original wayfinder rowTpl or in the modified YAMS rowTpl I made. I am not expecting a sub-list of documents, I am expecting a link within a list item, just like the others. In the code, you can see the commented wayfinder call that has not been YAMS-ified, right above the YAMS-ified version:

                             
                    <div id="menu" class="dark">
                    <!--<ul><li ><a id="menu1" href="http://www.quitsmokingin10days.com/" title="Home">Home</a></li>
                    <li ><a id="menu4" href="/product" title="Product">Product</a></li>
                    <li  class="active"><a id="menu5" href="/blog" title="Quit Smoking Blog">iQuit Blog</a></li>
                    <li ><a id="menu6" href="/about" title="About">About</a></li>
                    <li ><a id="menu7" href="/contact" title="Contact">Contact</a></li>
                    <li ><a id="menu8" href="/faq" title="FAQ">FAQ</a></li>
                    <li ><a id="menu9" href="/privacy" title="Privacy">Privacy</a></li>
                    <li  class="last"><a id="menu10" href="/sitemap" title="Sitemap">Sitemap</a></li>
                    </ul>-->
                    
                    
                    <ul><li ><a id="menu1" href="http://www.quitsmokingin10days.com/home" title="iQuit Smoking Home">iQuit Smoking Home</a></li>
                    <li ><a id="menu4" href="http://www.quitsmokingin10days.com/product" title="iQuit Product">iQuit Product</a></li>
                    <li class="active">
                      <span>Quit Smoking Blog</span>
                    </li>
                    <li ><a id="menu6" href="http://www.quitsmokingin10days.com/about" title="About iQuit">About iQuit</a></li>
                    <li ><a id="menu7" href="http://www.quitsmokingin10days.com/contact" title="Contact Us">Contact Us</a></li>
                    <li ><a id="menu8" href="http://www.quitsmokingin10days.com/faq" title="FAQ">FAQ</a></li>
                    <li ><a id="menu9" href="http://www.quitsmokingin10days.com/privacy" title="Privacy">Privacy</a></li>
                    <li  class="last"><a id="menu10" href="http://www.quitsmokingin10days.com/sitemap" title="Sitemap">Sitemap</a></li>
                    </ul>
                    </div>
                    


                    and again, the calls that create these lists, along with their rowTpls:

                    <!--[!Wayfinder?&startId=`0`&includeDocs=`1,4,5,6,7,8,9,10`&rowTpl=`menuTpl`!]-->
                    
                    
                    [!Wayfinder?&startId=`0`&includeDocs=`1,4,5,6,7,8,9,10`&rowTpl=`menuTplYAMS` &parentRowHereTpl=`@FILE:assets/modules/yams/tpl/wayfinder/doc/parentrowhere.tpl` &parentRowTpl=`@FILE:assets/modules/yams/tpl/wayfinder/doc/parentrow.tpl` &hereTpl=`@FILE:assets/modules/yams/tpl/wayfinder/doc/here.tpl` &innerRowTpl=`@FILE:assets/modules/yams/tpl/wayfinder/doc/innerrow.tpl` &innerHereTpl=`@FILE:assets/modules/yams/tpl/wayfinder/doc/innerhere.tpl` &activeParentRowTpl=`@FILE:assets/modules/yams/tpl/wayfinder/doc/activeparentrow.tpl` &categoryFoldersTpl=`@FILE:assets/modules/yams/tpl/wayfinder/doc/categoryfolders.tpl` &startItemTpl=`@FILE:assets/modules/yams/tpl/wayfinder/doc/startitem.tpl`!]
                    


                    My menuTpl chunk, for rowTpl in the normal Wayfinder call:
                    <li [+wf.classes+]><a id="menu[+wf.docid+]" href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a></li>
                    


                    My menuTplYAMS chunk, for rowTpl in the YAMS-ified Wayfinder call:
                    <li [+wf.classes+]><a id="menu[+wf.docid+]" href="(yams_doc:[+wf.docid+])" title="[[YAMS? &get=`content` &docid=`[+wf.docid+]` &from=`pagetitle`]]">[[YAMS? &get=`content` &docid=`[+wf.docid+]` &from=`pagetitle`]]</a></li>
                    
                      • 22851
                      • 805 Posts
                      Hi @towerofbabel

                      My understanding of how Wayfinder works was wrong. I assumed that Wayfinder would be using all its default templates unless they are overridden by the user using &...Tpl=`...`. However, your commented out Wayfinder call demonstrates that that isn’t the case: Wayfinder is clearly not using the &hereTpl or for the selected document - . It is using your customised &rowTpl instead. I checked with the Wayfinder documentation, and for rowTpl it says:
                      The rowTpl template is used to output each document, folder, or weblink (unless one of the templates below is used)
                      (I have highlighted the important bit.) There is similar extra logic for the outerTpl too, which is only overridden by the innerTpl if it is specified.

                      So, since the outer template doesn’t contain any YAMSified content, in general you only need to include the following parameter in your Wayfinder call to get the default behaviour:
                      &rowTpl=`@FILE:assets/modules/yams/tpl/wayfinder/mode/row.tpl`

                      where mode is replaced by doc or docr.

                      In your case you’ll need to use your custom rowTpl in place of the YAMS one.

                      Sorry for the confusion. Please let me know if this works. If so, I’ll update the YAMS documentation.

                      EDIT: Updated. OuterTpl is not needed.
                        YAMS: Yet Another Multilingual Solution for MODx
                        YAMS Forums | Latest: YAMS 1.1.9 | YAMS Documentation
                        Please consider donating if you appreciate the time and effort spent developing and supporting YAMS.