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

    I'm using YAMS on localhost (using xampplite) and with MODx 1.0.14.

    The page has two Wayfinder menus and one call to Ditto.

    The menus stay in the main language, and are not correctly styled on the translated pages. The call to Ditto is not executed, on the translated pages: it is printed.

    I observed that the path to MODx documents is wrong for the translated pages, so I suspect some .htaccess or configuration issue.

    Configuration
    The .htaccess file is:
    php_flag register_globals Off
    #AddDefaultCharset utf-8
    #php_value date.timezone Europe/Moscow
    
    Options +FollowSymlinks
    # Friendly URLs
    RewriteEngine On
    RewriteBase /somesite.ext/
    
    # Fix Apache internal dummy connections from breaking [(site_url)] cache
    RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
    RewriteRule .* - [F,L]
    
    # Exclude /assets and /manager directories from rewrite rules
    RewriteRule ^(manager|assets) - [L]
    
    # Redirect from mydomain.com/rootname to mydomain.com/rootname/
    RewriteRule ^fr$ fr/ [R=301,L]
    RewriteRule ^bg$ bg/ [R=301,L]
    RewriteRule ^en$ en/ [R=301,L]
    
    # The Friendly URLs part
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^fr/(.*)$ index.php?q=$1 [L,QSA]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^en/(.*)$ index.php?q=$1 [L,QSA]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

    In the template, the base href is set by:
    <base href="http://localhost/somesite.ext/" />

    In the configuration tab of YAMS module, the MODx Subdirectory is set to somesite.ext.


    Ditto
    The content of pages is inserted by [*#content*] and is correctly translated, excepted for the call to Ditto.
    The Ditto call is located in each of the TVs for content translation:
    "content_fr" / "content_en" and is:
    [!Ditto? &sortBy=`menuindex` &sortDir=`ASC` &tpl=`membre_comite` &extenders=`@FILE assets/modules/yams/yams.extender.inc.php` &id=`(yams_id)` &language=`(yams_mname)` !]


    Wayfinder
    The Wayfinder calls are:
    [!Wayfinder? &startId=`0` &level=`2` &config=`menu_horizontal` !]
    [!Wayfinder? &config=`menu_vertical` &startId=`[*wf_section*]` &outerTpl=`wfd_outerTpl_main_page`!] 


    The links inside Wayfinder menus look like:
    For French, main language, which is correct:
    <a href="http://localhost/somesite.ext/fr/index.php?id=123">...</a>
    
    For English, and that's wrong:
    <a href="/somesite.ext/index.php?id=123">...</a>


    Inside the Wayfinder configuration files, the chunks are like:
    $rowTpl = '@CODE:<li><a href="(yams_doc:[+wf.docid+])" title="" >[[YAMS? &get=`data` &docid=`[+wf.docid+]` &from=`pagetitle` ]]</a>[+wf.wrapper+]</li>';


    Any idea about what's wrong?
    Thank you very much.
      • 9995
      • 1,613 Posts
      Sorry, don't know about local / xampp.

      All I can see is that it looks like your htaccess is missing:
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule ^bg/(.*)$ index.php?q=$1 [L,QSA]]


      Or that is done on purpose..

      Did you grab the htaccess settings in your YAMS config tabs?
        Evolution user, I like the back-end speed and simplicity smiley
        • 15001
        • 697 Posts
        Thanks.
        In fact, in the .htaccess posted above, I just forgot to remove the line
        RewriteRule ^bg$ bg/ [R=301,L]


        There are in fact more than two languages, but I just kept two language in given .htaccess to shorten it for the forum.
        The given .htaccess was not grabbed from the YAMS config tabs, but is the (shortened) content of the .htaccess file.

        So, my issue remains.
          • 15001
          • 697 Posts
          Concerning Wayfinder, the issue of translating menus with YAMS could be solved by passing chunk parameters directly to the call the call of the snippet:
          [!Wayfinder? &rowTpl=`@FILE assets/snippets/wayfinder/.../tpl/row.tpl` ...!]

          It's worth noting that @FILE bindings works with YAMS+Wayfinder, but that configuration files called by
          &config=`name_of_configuration_file`
          don't.

          Concerning Ditto, I still could not make it work with YAMS, but I'll create another topic for this.
            • 9995
            • 1,613 Posts
            Dunno, did you try: [[Ditto instead of [!Ditto ?

            Or try to split language like this maybe?

            [[YAMS? &get=`chunk` &from=`membre_comite_chunk`]]


            in chunk membre_comite_chunk_fr add:
            [!Ditto? 
            &sortBy=`menuindex` 
            &sortDir=`ASC` 
            &tpl=`membre_comite-fr` 
            &language=`french` 
            !]


            in chunk membre_comite_chunk_en add:
            [!Ditto? 
            &sortBy=`menuindex` 
            &sortDir=`ASC` 
            &tpl=`membre_comite-en` 
            &language=`english` 
            !]


            or something like that.. and try [[ or [!


            This is how I do it in a chunk; chunkname_nl
            [!Ditto?extenders=`@FILE assets/modules/yams/yams.extender.inc.php` 
            &parents=`[*id*]` 
            &total=`99` 
            &showPublishedOnly=`1` 
            &orderBy=`menuindex ASC` 
            &noResults=`No results` 
            &tpl=`overzicht-inhoud_nl`!]
              Evolution user, I like the back-end speed and simplicity smiley