We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10405
    • 288 Posts
    Hi, I have a call to a Ditto article, which appears as teaser text on the home page of a site as follows:

    [!Ditto? &parents=`10` &depth=`0` &filter=`id,12,2|id,13,2|id,14,2|id,15,2|id,16,2|id,19,2` &tpl=`ditto.homepageblogpreview` &total=`1` &extenders=`summary` &truncLen=`100` &truncText=`Read More`!] 
    


    However the user has edited the text of the blog backend and so we need to change the number of characters displayed in order to make sure the extra sentence is displayed.

    So I’ve tried changing &truncLen to a higher value, but for some reason it only suddenly displays the sentence at around 142, and then it includes the first bit of text from the next line for some reason. So I try setting it to 140, then 139... it still displays exactly the same. Then I change it to 138 and all of a sudden it displays the same amount of text as it did when it was set to a value of 100!

    I looked into it a bit more and it looks as if it’s cutting the teaser text off if it sees a full stop followed by a space. If I remove thge space at the end of the first sentence so that the second one starts without a space first, it shows both sentences.

    The weird thing is that it seems to not cut off after the second sentence unless I edit &truncLen exactly to the right value- it includes the first few characters of the sentence afterwards (actually a bullet list but whatever)

    Any ideas anyone?
      • 25132
      • 129 Posts
      Would it be adding the tag characters to the number of characters for truncations, i.e. your bulleted list tags such as <ul>, <li> etc. I don’t usually use the summary extender and truncation for this kind of purpose because it causes exactly this problem. Better off to use the summary field in your resource editor of the blog entry to copy and paste the amount of text you want from your resource content to be in the teaser field and then call the [+introtext+] as part of your ditto &tpl instead of the summary/truncation bits.