1

I have the plugin working fine and pulling in {description} however I'd like to be able to shorten the length of that text. I've tried the following addons:

Character Limit, Word Limit, and TruncHtml

I also tried to set this up using Magpie RSS Parser, and none of these worked with that either. Is this just not possible?

Thanks

Edited to add: Also tried Hacksaw

Edited to add code: {exp:magpie url="{embed:feed}" limit="3" refresh="720"} {items}

{title}

{exp:eehive_hacksaw char="100"} {description} {/exp:eehive_hacksaw} {/items} {/exp:magpie}

I have a feeling this is a parsing issue.

3
  • Can you post some template code examples that didn't work for you?
    – jrothafer
    Jul 16 '15 at 20:02
  • Added the code. I switched to magpie but also same issue with FeedParser. I think it's a parse order issue.
    – Mel
    Jul 16 '15 at 21:27
  • Thanks! I have a bunch of custom plugins in the wild, I'll see if I can defeat this issue. This IS a custom plugin issue, and not a different type of addon? I can try and debug whatever, but clarification helps.
    – jrothafer
    Jul 17 '15 at 12:05
1

Your code will definitely work, and you're right it's a parse order issue. You just need the parse="inward" parameter on the magpie tag.

{exp:magpie url="{embed:feed}" limit="3" refresh="720" parse="inward"}
    {items}
        {title}
        {exp:eehive_hacksaw char="100"}
            {description}
        {/exp:eehive_hacksaw}
    {/items}
{/exp:magpie}

From the ExpressionEngine docs on changing parsing order when using plugins:

You may change the parsing order and instruct ExpressionEngine to parse an outer Plugin first. This is done by adding a parse=”inward” parameter to the Plugin opening tag. Using that parameter will tell EE to parse that Plugin before parsing any Plugins inside of it.

2
  • Thanks Alex. I remembered that parameter about 2 days later. I always forget. Thanks for adding that info here. I appreciate it.
    – Mel
    Jul 24 '15 at 19:04
  • Glad to hear it. :-)
    – Alex Kendrick
    Jul 24 '15 at 19:06
0

Trunch and Hacksaw should work, but, understand that they'd be truncating the content on the front-end / template side, and wouldn't be altering the actual content in the database.

I believe you could set the description field to a text input and set the maximum length, and all of the fields would get truncated on the database-side. It wouldn't look very good (things would get cut-off mid-word), but, that's how you could do it on the back-end with the actual data.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.