We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2661
    • 53 Posts
    badnewsblair Reply #1, 17 years ago
    Perhaps I’m missing a backtick or something small. However, I can’t seem to get truncate to work correctly. Ideally, I’d like to not have to enter anything in to my Intro Text field for my resource. I’d like the Truncate parameter to take what’s in my content, truncate automatically and add a hyperlinked "..." to the end.

    Where am I going wrong? Is Summary deprecated? As always, thanks in advance.

    My Ditto call:

    [!Ditto? &parents=`10` &depth=`1` &display=`6` &orderBy=`createdon DESC` &paginate=`1` &paginateAlwaysShowLink=`1` &showPublishedOnly=`1` &extenders=`summary` &trunc=`1` &truncLen=`50` &tpl=`indexpage` !]


    My Indexpage Chunk:
    <div id="gallery-piece">
    				<div id="gallery-title"><h2><a href="[+url+]">[+pagetitle+]</a></h2></div>
    				<span class="from">[+from+]<br /></span>
    				<div id="gallery-text">[+summarize+][+link+]</div>
                                    <p>[+phx:if=`[+firstimage+]`:ne=``:then=`<a href="[+url+]"><img src="[+firstimage+]" width="260" height="195" alt="[+pagetitle+]" /></a>`:else=``+]</p>
    				
    			</div>

      • 2661
      • 53 Posts
      badnewsblair Reply #2, 17 years ago
      I changed [+summary+] to [+summarzie+], based off of http://wiki.modxcms.com/index.php/Ditto_2.1_placeholders but I’ve lost the text in the gallery-text div all together. [+link+] is showing up as default of "Read more..." instead of just "..." as I’ve specified in &truncText.
        • 33337
        • 3,975 Posts
        Zaigham (aka zi) Reply #3, 17 years ago
        You didnt tell what exactly the happening? Your call seems to be all right and IIRC that is [+summary+] instead of [+summarize+]

        Does it output anything? or not anything at all?

        This should give more insight: http://ditto.modxcms.com/extenders/summary.html
          Zaigham R - MODX Professional | Skype | Email | Twitter

          Digging the interwebs for #MODX gems and bringing it to you. modx.link
          • 16278
          • 928 Posts
          Whoops! My typo - [+summary+] is correct, have put it right on the Wiki page.
          shocked KP
            • 2661
            • 53 Posts
            badnewsblair Reply #5, 17 years ago
            Okay, it looks like if I omit the Introtext field, it is working. However, it is automatically getting wrapped in a <p></p> code, which is throwing off the page. I suppose I can overtake the CSS for that?
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              That is TinyMCE being overly helpful. There are a number of things you can do about it; you can open the content in HTML mode (with the little HTML button in the editor’s toolbar) and remove the extra <p> tags; you can set that document to not use the rich text editor at all; or you can configure TinyMCE to not add those tags every time it thinks you don’t know what you’re doing.
                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
                • 2661
                • 53 Posts
                badnewsblair Reply #7, 17 years ago
                On items that I’ve omitted the Introtext, It is Truncating properly, but the link isn’t showing up at all.

                On items I have not omitted the Introtext, it is not Truncating properly (I think this is working as intended), but the link is working, only it reads the default "Read more...".
                  • 2661
                  • 53 Posts
                  badnewsblair Reply #8, 17 years ago
                  Yeah, most of the times, I love Tiny. Like when I am copy and pasting and it keeps format. However, its done this to me a couple of times with <p></p> tags. I will be entering a lot of items, and I don’t see having to edit out the <p></p> in each. What do you suppose I do to overcome that?
                    • 2661
                    • 53 Posts
                    badnewsblair Reply #9, 17 years ago
                    Everything is working as intended, except for this addition of the <p></p> tag. I suppose the quick way to fix this is to disable TinyMCE by default on the creation of new items.
                      • 28042 ☆ A M B ☆
                      • 24,524 Posts
                      That is one thing I have against TinyMCE; if you go to their forums and look up questions on this, the developers are quite adamant that their way is the right way, and anybody who doesn’t want to do it their way is being stupid. It would be a lot better if they simply made it easier to disable/enable these "features", such as automatically adding <p> tags everywhere, or converting & to &amp; all the time. The user should always have a clear path to preventing/allowing "behind-your-back" modifications to what he actually puts in.
                        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