Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
fly_excerpt - Truncate Article Excerpt
This little Helper-Plugin can truncate the words from an Article Excerpt.
<txp:fly_excerpt />
truncate
– How many words should the Excerpt have – Default: 10more
– String to show User there is more content. Default: …link
– Show “more” String as HTML Link. Values 0(no) or 1(yes). Default: 0class
– Optional HTML Class Name for “more” String Link
- http://www.flyweb.at/blog/projects/971/cms-textpattern-excerpt-plug-in
- https://github.com/brachycera/fly_excerpt
Changelog
Version 1.02 (28. Sept. 2016)
- Added register for fly_excerpt Tag `->register(‘fly_excerpt’)` for compatibility to Textpattern Ver. 4.6.0
Version 1.01 (16. Feb. 2015)
- Bugfix for Excerpt with HTML Code
Version 1.0 (16. Feb. 2015)
- Initial Release
Last edited by superfly (2016-09-28 09:04:22)
<code>is</poetry>
Offline
Re: fly_excerpt - Truncate Article Excerpt
Suppose you have an article like this:
There is <b>bold text</b> in this line.
If you set truncate to 3, then your plugin creates the following excerpt:
There is <b>bold
But it should be:
There is <b>bold</b>
Offline
Re: fly_excerpt - Truncate Article Excerpt
In reply to ruud #288308:
Hey ruud,
Thanks for the feedback! I made a quick Hotfix, until I can come up with a better solution, I striped the HTML Code from the Excerpt.
<code>is</poetry>
Offline
Re: fly_excerpt - Truncate Article Excerpt
thank you for this one!
Maybe you should mention, that one has to wrap the excerpt with tags.
<p><txp:fly_excerpt truncate="50" /></p>
At least <txp:excerpt /> returns the text already inside <p> tags.
Last edited by whocarez (2015-04-21 20:47:20)
Offline
Re: fly_excerpt - Truncate Article Excerpt
cool plugin. one of the reasons that i don’t use the excerpt very much was that one could not truncate the output.
I think one for <body> would also be cool. i.e.
<p><txp:fly_body_excerpt truncate="50" /></p>
ps can one wrap the tag in If / Else for those times when there is no <excerpt> ?
Last edited by bici (2015-04-19 23:46:47)
…. texted postive
Offline
#6 2015-04-20 08:20:03
- candyman
- Member
- From: Italy
- Registered: 2006-08-08
- Posts: 684
Re: fly_excerpt - Truncate Article Excerpt
Wow: only 19 posts and two three1 plugins as a present to the community!
Nice site, too, BTW.
1 : Apart the previous fly_cat_restriction and the brand new fly_excerpt I discovered also this: Amazon & LastFM plugin (with the old – not standard – fw prefix). I’m asking if are there others…
Last edited by candyman (2015-04-20 08:47:45)
Offline
Re: fly_excerpt - Truncate Article Excerpt
bici wrote #290128:
ps can one wrap the tag in If / Else for those times when there is no <excerpt> ?
there is a native tag for that.
<txp:if_excerpt>
<p><txp:fly_excerpt truncate="50" /></p>
<txp:else />
</txp:if_excerpt>
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Offline
Re: fly_excerpt - Truncate Article Excerpt
Nice site, too, BTW.
indeed Super Site by Super Fly!
Jeez, I should read the Forums more often. candyman, bici thanks a lot for the probs!
Last edited by superfly (2016-09-27 22:18:57)
<code>is</poetry>
Offline
#10 2016-09-27 19:47:15
- candyman
- Member
- From: Italy
- Registered: 2006-08-08
- Posts: 684
Re: fly_excerpt - Truncate Article Excerpt
Welcome back! Have you read the news? Hope your plugins are ready.
Last edited by candyman (2016-09-27 19:47:36)
Offline
Offline