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

    Very nice improvement. That was actually needed.

    However, what about [(site_name)] ?

    the browser window title display the page title, but i usually build it with [(site_name)] [*pagetitle*], so I wander if there could be some way to imporve again your system to add some parameterd site name...

    Thank you
      Schtroumpf Grognon - Grouchy Smurf
      ---------------------------------
      Faites pas attention.. - Don't pay attention
      http://www.dzi-neo.net
    • I would make that a TV using @INHERIT, and setting an actual value in each language parent document. Then use [*site_name*] instead of [(site_name)].
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 8790
        • 526 Posts
        susan:
        Thank you, seams a good way to look at (I’m not ease with @inherit yet)


        I also suggest to modify nicely the "flagAndLanguage" chunk in order to make the  language link more accessible, adding to them a title.

        I chose to use the description field from the parent language folder (set respectively to ie "English pages section" and "Section Française"...)

        them add in the a href tag for the language link
        title="[+wf.description+]"


        I thought this could only returns the current page’s description, but it works like I felt: it  returns the language folder’s description, so everything is right and the flags are now "xhtml better"
          Schtroumpf Grognon - Grouchy Smurf
          ---------------------------------
          Faites pas attention.. - Don't pay attention
          http://www.dzi-neo.net
          • 8790
          • 526 Posts
          Where can I find @inherit documentation.


          Nothing found on new modx site nor svn

          Thank you
            Schtroumpf Grognon - Grouchy Smurf
            ---------------------------------
            Faites pas attention.. - Don't pay attention
            http://www.dzi-neo.net
          • It’s embarrassingly simple (I say embarrassingly because it took me so long to figure it out, then I was embarrassed.)

            The default value is @INHERIT (when creating the TV). Open a parent (container) document for editing and edit the TV’s field. All the children of that parent document will inherit that value. Don’t touch the @INHERIT value in the TV’s field for any of the children (unless, of course, you want that child document to have a different value for the TV).

              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
              • 8790
              • 526 Posts
              yes,

              Thank you


              I found it yesterday by myself, but finding documentations within the new website is more embarrassing undecided
                Schtroumpf Grognon - Grouchy Smurf
                ---------------------------------
                Faites pas attention.. - Don't pay attention
                http://www.dzi-neo.net
                • 8790
                • 526 Posts
                Hi,

                Ganesh you should use different chunk to call separately whatever you like with Wayfinder.

                The need for root level folder for languages, does introduce some constraints for WF menu, for sure.

                You could exclude and INCLUDE page ID in each WF call (&exclude id1,id2,idn...). refer to WF documentation
                (here for instance : http://www.muddydogpaws.com/development/wayfinder/parameters.html)
                  Schtroumpf Grognon - Grouchy Smurf
                  ---------------------------------
                  Faites pas attention.. - Don't pay attention
                  http://www.dzi-neo.net
                  • 8790
                  • 526 Posts
                  Hi,

                  Going back to site name management.

                  Like Susan told, it’s a  good idea to:

                  • introduce a TV and declare its value for each parent language folder,
                  • and setup @inherit for the default value. Then use this [*tv*] in <title> building or whatever..(SEO an ergonomic concerns)
                  But, if we want some universal pages (such as the unique 404 error page, as described in this tutorial) we face some issue, because, as such a page is out of the language tree, it can’t get in anyway the TV value.

                  But when we create the asset/language/$language.php  files we introduce another way the parameter some value, independently from the MODx tree.

                  So I suggest to add the following statement in each language file

                  here’s one for fr.php
                  <?php
                  $modx->setPlaceholder("errorpage",'404 - Page introuvable');
                  $tvPr = $modx->getTemplateVarOutput(array("site_name_translation"),$docid='6');
                  $modx->setPlaceholder("tvnomdusitetraduit",$tvPr['site_name_translation']);
                  ?>

                  the $docid=’6’ is in my case the french language folder.
                  I assume some better php dev could also improve this by collecting automatically the right folder id without having to setup manually the doc id here (?)


                  • So, we created a new PL wich is universal and contains the right text in the right language in order to display correctly the site name, and we can use it wherever we need it, instead of directly the TV value.


                  Ok, you say why such a complexity, why using also this TV ?

                  Because, this way the USER in charge for page edition will be able to deal with the site name himself, cause he dont have to be concerned by php files.


                  Hope this idea will help someone and could be part of this cool multiling system.






                    Schtroumpf Grognon - Grouchy Smurf
                    ---------------------------------
                    Faites pas attention.. - Don&#39;t pay attention
                    http://www.dzi-neo.net
                    • 8790
                    • 526 Posts
                    hum I found something I cant solve to find a WF starting point:

                    If I want some sub folder into each parent language folders:
                    I made a WF menu to deal with only the sub folder pages
                    (pageA1 corresponds to A2 in another language, etc.)
                    - lang1
                    +-sub folder
                    +-pageA1
                    +-pageB1
                    - lang2
                    +-sub folder
                    +-pageA2
                    +-pageB2

                    But how to make WF sart at the sufolder only cause we have the [+LanguageID+] but no logic to find a specific sub folder no?? yes ?

                    I guess this time using include is not the point.
                    [!Wayfinder? &startId=`[+LanguageID+]` &level=`2` &outerTpl=`menuv-outer-tpl` &rowTpl=`menuv-inner-tpl` &excludeDocs=`16,17`!]


                    Thank you
                      Schtroumpf Grognon - Grouchy Smurf
                      ---------------------------------
                      Faites pas attention.. - Don&#39;t pay attention
                      http://www.dzi-neo.net
                      • 10442
                      • 3 Posts
                      Quote from: elz64 at May 17, 2009, 07:42 AM

                      Hi,

                      Ganesh you should use different chunk to call separately whatever you like with Wayfinder.

                      The need for root level folder for languages, does introduce some constraints for WF menu, for sure.

                      You could exclude and INCLUDE page ID in each WF call (&exclude id1,id2,idn...). refer to WF documentation
                      (here for instance : http://www.muddydogpaws.com/development/wayfinder/parameters.html)


                      Hi,
                      thanks for your answer elz64.
                      I must admit that I don’t totally follow your explanation. I don’t properly understand how chunks work (yeah not kiddin’ about the newbie part..=) ).
                      The problem with include comand in the WF is that it is not language dependent.
                      I worked a temporary solutions wich is not perfect.

                      1) The "about" link that is on top of the page (not in the normal menu) :
                      <li><a href="[+LanguageID+]/about.html" title="About">About</a></li>

                      I then created a folder for each language with name and alias equal to the language id, and in the folders an about.html, depending on the language.

                      Caveats:
                      -The link is always called about (I didn’t manage to make it language dependent)
                      -once on the about.html page, the [+LanguageID+] changes to the id of the folder that has the language folder’s id as name. So if I click again on about, I end up to a wrong page. TO be clearer, suppose french folder has id 60, and english id 61. I create two folders named 60 and 61, alias 60 and 61, and with respective id 70 and 71 for example. In the folders, a page about.html
                      If I am in french language, the about links to 60/about.html. In English to 61/about.html. The good language specific about.html page appears correctly.
                      Then once on the french about.html page, the new about link becomes 70/about.html and 71/about.html for English, leading obviously to 404.


                      2) For the Welcome message, always on top of the menu, that I wanted language dependent, I set it to [*description*] and edited the description of every page of my website to ’Welcome’ in the english folder and ’Bienvenue’ in the french one. It is not a very intelligent method, and is time consuming.
                      I thought of creating a TV, and to prevent from specifing on each page the welcome message, I wanted to make the welcome text to default value. However I do not know how to make the default value of the TV language dependent, so I was back to square one.


                      If anybody has suggestions to help me out, please do suggest!

                      Thanxs