We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13137
    • 204 Posts
    How can I move the "Read more..." text found in "assets/snippets/ditto/extenders/summary.extender.inc.php" to the Ditto language files?

    I have added
    $_lang['read_more'] = "Read more...";
    to "assets/snippets/ditto/lang/lang_en.php", but dont understand how it is called into the above file.
      • 36592
      • 970 Posts
      The language file is loaded into Ditto when you specify &language parameter.
      (&language=`english` loads english.inc.php)

      But you can change "Read more... " with &truncText parameter.
      http://ditto.modxcms.com/extenders/summary.html
        • 13137
        • 204 Posts
        Thanks for such a quick reply, but this doesnt seem to be working.

        What I had done was add
        &language=`spanish` &truncText`Leer mas...`
        in the ditto call, which did change the "Previous/Next" but not the "Read me"

        I also tried to replace "Read me..." with $_lang[’more_text’] and add $_lang[’more_text’] = "Leer mas..."; to the lang file, which ended with an error:
        Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in E:\xampp\htdocs\modx-0.9.6.3\assets\snippets\ditto\extenders\summary.extender.inc.php on line 66


        So what am I missing here?
          • 36592
          • 970 Posts
          Show us your Ditto snippet call and its template chunk.
            • 13137
            • 204 Posts
            Ditto call:
            [[Ditto? &language=`spanish` &truncText`Leer mas...` &dateFormat=`{{NiceDate}}` &startID=`2` &summarize=`2` &removeChunk=`Comments` &tpl=`ditto_blog` &paginate=`1` &extenders=`summary,dateFilter` &paginateAlwaysShowLinks=`1` &tagData=`documentTags` &tplFirst=`first` ]] 


            Chunk:
            <div class="ditto_summaryPost">
              <h3><a href="[~[+id+]~]" title="[+title+]">[+title+]</a></h3>
              <div class="ditto_info" >By <strong>[+author+]</strong> on [+date+]. <a  href="[~[+id+]~]#commentsAnchor">Comments
              ([!Jot?&docid=`[+id+]`&action=`count-comments`!])</a></div><div class="ditto_tags">Tags: [+tagLinks+]</div>
              [+mySummary+]
              <p class="ditto_link">[+link+]</p>
            </div>


            Added line to "ditto/lang/spanish.php"
            $_lang['more_text'] = "Leer mas...";     


            and have tried various combinations, such as changing the ditto call to &truncText`$_lang[’more_text’]`, but nothing seems to work undecided
              • 36592
              • 970 Posts
              &truncText`Leer mas...`

              You forgot "=" ...
                • 13137
                • 204 Posts
                shocked I cant believe it. What a dork. Yes, that magically fixed the problem.

                Thanks for spotting my error.