We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9994
    • 133 Posts
    How do I?

    On the homepage I’d like to preview some newsmessages.

    I have a chunk with this ditto call:
    [!Ditto? &extenders=`@FILE assets/modules/yams/yams.extender.inc.php` &parents=`6`&orderBy=`createdon ASC` &noResults=`Some dutch text.` &tpl=`nieuws_homepage_inhoud`!]


    I have a chunk with:
    <span class="kop">[+title+]</span><br>
    <hr>
     [+content:notags:limit=`120`+]...
    <a href="[~[+id+]~]">Dutch text »</a><br><br>


    Like to know:
    - how do i get the titles of the language tabs? At every language i get the main title so i cant translate. [+title+] doesnt work correct.
    - Is it possible to make different tpl’s? because on the bottom of the message i’d like to add a linktekst which needs to be translated.
    - &noResults, how can i make this to be translated?
    - is it correct if my page alias is always the same?, on the tabs i can also enter the alias.
      Best CMS eva!
      • 22851
      • 805 Posts
      Hi @fourroses.

      Before I answer your questions, I note that you are using PHx to truncate the length of the content field: [+content:notags:limit=`120`+] Unfortunately, at present this might cause problems for YAMS. So, if you do encounter problems with text like (yams-...) all over the place, please try removing the limit=`120` and try again. I don’t currently have a workaround for this I’m afraid, so if you do encounter problems you might need to use something like the introtext field to include a short summary.

      Quote from: fourroses at Nov 06, 2009, 12:44 PM

      - how do i get the titles of the language tabs? At every language i get the main title so i cant translate. [+title+] doesnt work correct.
      Only standard Ditto fields are supported at present. Please try pagetitle or longtitle.

      Quote from: fourroses at Nov 06, 2009, 12:44 PM

      - Is it possible to make different tpl’s? because on the bottom of the message i’d like to add a linktekst which needs to be translated.
      You could use a different ditto call for each language, each of which uses a different ditto template. Alternatively, you can use a single ditto call and template, but use:
      [[YAMS? &get=`text` &from=`en::English Text||ru::Russian Text||lang::language text||...`]]
      

      or
      [[YAMS? &get=`chunk` &from=`mychunk`]]
      

      where mychunk_en, mychunk_ru etc. are chunks containing the text to specify the link text in the various languages.

      Quote from: fourroses at Nov 06, 2009, 12:44 PM

      - &noResults, how can i make this to be translated?
      Please try something like...
      &noResults=`[[YAMS? &get=`text` &from=`en::English Text||ru::Russian Text||lang::language text||...`]]`
      


      Quote from: fourroses at Nov 06, 2009, 12:44 PM

      - is it correct if my page alias is always the same?, on the tabs i can also enter the alias.
      Sorry, I am not entirely sure what you mean by that, but your use of "[~[+id+]~]" looks fine to me.

        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.
        • 9994
        • 133 Posts
        Ok thanx allot grin, got 2 questions;

        When i use this within my dittocall: &tpl=`nieuws_homepage_inhoud_nl` it works
        When i use this within my dittocall: &tpl=`[[YAMS? &get=`chunk` &from=`nieuws_homepage_inhoud`]]` i get an error sad

        I have made chunk ’nieuws_homepage_inhoud_nl’ and ’nieuws_homepage_inhoud_en’.

        ########

        With alias i mean the following:
        I make a new page, page alias i call: nieuws.
        I also have some languagetabs, like Dutch / English, there are some TV fields calles alias (en) , alias (nl).
        So when i put Nieuws and News into it, normally the page url has to be www.blabla.com/news.html or www.blabla.com/nieuws.html, but all i get on both languages is what i have entered on the main ’page alias’ field.

        So i dont know if its possible when u (frontend) change languages u see the url being changed from nieuws.html to news.html.
          Best CMS eva!
          • 22851
          • 805 Posts
          Quote from: fourroses at Nov 06, 2009, 03:00 PM

          When i use this within my dittocall: &tpl=`nieuws_homepage_inhoud_nl` it works
          When i use this within my dittocall: &tpl=`[[YAMS? &get=`chunk` &from=`nieuws_homepage_inhoud`]]` i get an error sad
          That’s right. You can’t use a YAMS call to specify the Ditto template like that I’m afraid. The YAMS snippet call doesn’t output the chunk contents, it outputs a special construct that Ditto doesn’t understand. Instead, you can put
          [!Ditto? &extenders=`@FILE assets/modules/yams/yams.extender.inc.php` &parents=`6` &orderBy=`createdon ASC` &noResults=`At the monent there are no messages.` &tpl=`nieuws_homepage_inhoud_en` !]

          in your English content field and
          [!Ditto? &extenders=`@FILE assets/modules/yams/yams.extender.inc.php` &parents=`6` &orderBy=`createdon ASC` &noResults=`Er zijn momenteel geen berichten.` &tpl=`nieuws_homepage_inhoud_nl` !]

          in your dutch/flemmish content field.

          Quote from: fourroses at Nov 06, 2009, 03:00 PM

          With alias i mean the following:
          I make a new page, page alias i call: newspage.
          I also have some languagetabs, like Dutch / English, there are some TV fields calles alias (en) , alias (nl).
          So when i put Nieuws and News into it, normally the page url has to be www.blabla.com/news.html or www.blabla.com/nieuws.html, but all i get on both languages is what i have entered on the main ’page alias’ field.

          So i dont know if its possible when u (frontend) change languages u see the url being changed from nieuws.html to news.html.
          It sounds like you want to use unique multilingual aliases. You need to go to Modules > YAMS > Other Params and set:

          Uniqueness of Multilingual Aliases: Unique
          Multilingual Aliases: Yes

          and press Update. You may then need to update your .htaccess. Check it against the YAMS > Server Config tab.
            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.
            • 9994
            • 133 Posts
            Ok thanx! i got it sorted, works great.

            To bad my ’YAMS? list thing’ where i can change language doesnt work if i have a unique alias, so i made it go to the homepage.
              Best CMS eva!
              • 22851
              • 805 Posts
              Quote from: fourroses at Nov 06, 2009, 04:39 PM

              To bad my ’YAMS? list thing’ where i can change language doesnt work if i have a unique alias, so i keep my pagenames 1 language, it’s not that terrible tongue
              How are you generating a list of languages? Are you using something like:
              [[YAMS? &get=`list`]]

              That should work. If it is not, please can you explain in what way it is not working? Thanks.
                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.
                • 9994
                • 133 Posts
                Hi PMS, late call here, well if I click on it, the url will only change from /nl/dutchuniqueurl.html into /en/dutchuniqueurl.html and not my englishuniqueurl.html

                At the moment i have solved it by making an flagimage chunk and go to the homepage. It’s ok but wonder why it doesn’t look for the unique url.

                Digging deeper into this;
                I did changed the .htaccess as YAMS gives , ánd i also had set Multilingual Aliases on unique and on yes.
                BUT it must be the menulinks. I think there must be something wrong with wayfinder?
                [[Wayfinder? &startId=`0` &level=`1` &hideSubMenus=`1` &rowTpl=`@FILE:assets/modules/yams/tpl/wayfinder/doc/row.tpl`]]

                or i have set some config on YAMS incorrect :S
                  Best CMS eva!
                  • 22851
                  • 805 Posts
                  Hi @fourroses.

                  On further investigation this is a YAMS bug that only affects unique multilingual alias mode when NOT using server names or root names. I’ll send you a personal message with subversion details so that you can download my bleeding edge version that contains a fix for you to test.
                    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.