We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1266
    • 50 Posts
    I’m using the Yams + Ditto + Phx implementation explained here: http://svn.modxcms.com/docs/pages/viewpage.action?pageId=15138852 for my site, and in two places, I use this line in a Ditto template.

    [*phx:input=`((yams_data:[+id+]:content_(yams_id)))`:word_limit=`70`*]


    The word_limit is a custom PHX modifier from the wiki. In one place, it works exactly how you’d expect. In the other the content doesn’t get clipped at all. Any ideas on why it might be inconsistent? Here are the templates if it helps.

    Works:
    <div class="blogItem">
    <div class="blogByline floatL">
    [*phx:input=`[+date+]`:nl2br*]<br />
    <span class="blogPosted">posted by</span><br />
    [+author+]
    </div>
    <div class="blogBlurb floatL">
    <p><a class="blogItemTitle" href="[+url+]">[+pagetitle+]</a></p>
    [*phx:input=`((yams_data:[+id+]:main-image))`:isempty=``:then=``:else=`<div class="floatL blogImagePreview"><img src="[+main-image+]" alt="Preview image"></div>`*]
    [*phx:input=`((yams_data:[+id+]:content_(yams_id)))`:word_limit=`70`*]…<a href="[+url+]">[+lang_select+]</a></p>
    <p class="blogTags">TAGS: [+tagLinks+]<br />COMMENTS: <a href="[+url+]#comments">[[Jot? &action=`count-comments` &docid=`[+id+]` &tagid=`(yams_id)`]]</a></p>
    </div>
    </div>


    Doesn’t work:
    <h2>[+pagetitle+]</h2>
    [*phx:input=`[+main-image+]`:isempty:then=``:else=`<div class="frontImage"><img src="[+main-image+]" alt="Preview image" /></div>`*]
    [*phx:input=`((yams_data:[+id+]:content_(yams_id)))`:word_limit=`70`*]…<a href="[*phx:input=`[+parent+]`:is=`23`:then=`[~23~]#[+id+]`:else=`[+url+]`*]">[+lang_select+]</a></p>