We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23950
    • 78 Posts
    Hello smiley

    like i said in the title, i’m trying to display some news (on my home page), with the most recent one in a special chunk.

    i have this Ditto call in my home page template:
    [!Ditto? &extenders=`summary,@FILE assets/modules/yams/yams.extender.inc.php` &id=`bignews` &language=`(yams_mname)` &parents=`43` &display=`1` &seeThruUnpub=`1` &dateFormat=`%d %b %Y` &tpl=`BigNewsAccueilTpl` &trunc=`1` &truncLen=`30` &truncSplit=`0` !]


    here is the [tt]BigNewsAccueilTpl[/tt] chunk:
    <h3>[+pagetitle+]</h3>
    <p class="date">[+date+]</p>
    <p>[+summary+]
    <span class="more"><a href="[~[+id+]~]">» [[YAMS? &get=`tv` &from=`LinkMore`]]</a></span>
    </p>
    <hr style="clear:right" />


    And here is the result (in french):
    http://self/pic/e07d7bf3dce73d9d7255ec24a31737f9577cc8d7.png" border="0" />

    As you see, [+summary+] is not rendered... however, i have some text in the [tt]introtext[/tt] and [tt]content[/tt] fields (in all languages)...

    any idea ?
      [b] MES SITES SOUS MODx
      • 23950
      • 78 Posts
      i tried with [tt]&truncLen=`60`[/tt] or 90, and [tt][+bignews_summary+][/tt] instead of [tt][+summary+][/tt]

      still not work :/
        [b] MES SITES SOUS MODx
        • 22851
        • 805 Posts
        Hi @prouve.

        Unfortunately, the YAMS Ditto extender that I have written only makes the standard document variables multilingual (pagetitle, longtitle, introtext, etc...). I have just taken a look at the summary extender to see if I could make it multilingual. I’ve run into difficulties because it looks like Ditto extenders are designed to operate on standard document variables, but not on template variables. So, I could grab the document id and use that to get the values of the template variables I need from the database ... but I know from experience that that can be quite inefficient.

        Does anyone know how to get Ditto to pass the values of template variables to extenders? I’d like to achieve something like...

        $placeholders['example'] = array(array("pagetitle","my_custom_tv_goes_here"),"exampleFunction","pagetitle");
        
          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.
          • 23950
          • 78 Posts
          Hello PMS smiley

          Oh so this feature is not implemented yet... i’m gonna wait your next release ^^

          don’t forget to lowercase the multilingual aliases wink
            [b] MES SITES SOUS MODx
            • 22851
            • 805 Posts
            Quote from: prouve at Nov 10, 2009, 08:28 AM

            Oh so this feature is not implemented yet... i’m gonna wait your next release ^^
            No, it’s not implemented yet I’m afraid. I’ll see what I can do.

            Quote from: prouve at Nov 10, 2009, 08:28 AM

            don’t forget to lowercase the multilingual aliases wink
            Please can you remind me exactly what you are after here? Are you wanting the multilingual aliases to be converted to lowercase when a document is saved? If so, then this is already possible. YAMS will activate the MODx OnStripAlias event on multilingual aliases provided the following is set:

            Modules > YAMS > Other Params > URL Formatting > Use MODx StripAlias

            TransAlias is normally active on the OnStripAlias event, so all you have to do is edit/configure TransAlias to produce lower case aliases. You can follow the instructions in this post.
              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.
              • 23950
              • 78 Posts
              i guess u can forget the summary support. As i saw on this forum, everybody uses the PHx "character_limit" function.

              btw, i improved the PHx truncate function wink http://wiki.modxcms.com/index.php/PHx/CustomModifiers#phx:character_limit


                [b] MES SITES SOUS MODx
                • 22851
                • 805 Posts
                Okay. Thanks for sharing 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.
                  • 19328
                  • 433 Posts
                  Hi PMS, prouve,

                  I’m trying to accomplish exactly the same, but can’t make up out of this thread if YAMS is already able to handle the PHx character_limit.

                  I’m using prouves improved the PHx truncate function. The codes I’m using:

                  Ditto call:
                  [!Ditto?extenders=`@FILE assets/modules/yams/yams.extender.inc.php` &id=`(yams_id)` &language=`(yams_mname)` &tpl=`tpl_news_list_home` &startID=`4` &orderBy=`menuindex ASC` &summarize=`2`!]


                  ’tpl_news_list_home’ chunck:
                  <li><h3><a href="[~[+id+]~]">[+pagetitle+]</a></h3>
                  <p class="news_date">[+createdon:date=`%d-%m-%Y`+]</p>
                  <p>[+content:character_limit=`50`+]</p></li>


                  ’phx:character_limit’ snippet:
                  <?php
                  if (strlen($output) > $options) {
                  		$output_cutted = substr($output, 0, $options);
                  		$last_space = strrpos($output_cutted, " ");
                  		$output = substr($output_cutted, 0, $last_space) . " [...]";
                  	}
                  	return $output;
                  ?>


                  MODX 1.0.2
                  YAMS 1.1.7 alpha RC7
                  Ditto 2.1.0
                  PHx 2.1.3

                  This will only output the [..], with no content. If I change the [+content:character_limit=`50`+] in the ’tpl_news_list_home’ chunk to [+content_en:character_limit=`50`+], it works, but only for the language with ’en’ ID.
                  YAMS if functioning properly throughout my site.

                  Do you have any idea how to make YAMS work with the character_limit?