Categories:
Author:
Current version:
0.1
About It:
Get it:
Rate it:
Flag it:
cnj_excerpt_logic
Here is a simple plugin that allows logic if the excerpt is empty or if it is not empty. How to use the code, and an example of how I use it is part of the plugin help. Basically if I have a long post I put the short front page part in the excerpt and then continue the article in the body, but if it is a short entry I just use the body of the article, this plugin enables my form to display just the excerpt or the body depending on if the excerpt has content.
Initially released:
2004-04-19Posted here:
23 Mar 2005Article modified:
02 Nov 2006









You may want to leave your comments/questions at the Forum thread for quicker feedback. Otherwise, comment away:
Commented (4)
some help from wonderful, incredible persons Remillard and ubernostrum gave me the following solution:
in place of the current cnj_excerpt_logic plugin text, have this:
function cnj_if_excerpt($atts, $thing) {
global $thisarticle;
if(preg_match(’/\S/’, $thisarticle[‘excerpt’])) {
return parse($thing);
} else {
return;
}
}
function cnj_if_not_excerpt($atts, $thing) {
global $thisarticle;
if(!preg_match(’/\S/’, $thisarticle[‘excerpt’])) {
return parse($thing);
} else {
return;
}
}
Sadly, I think that this may be a very well written plugin—with very poorly written descriptions.
Can anyone break this down for me?
I’m hoping this simply will look at a post, and if it is long, put a shortened version of the post in the excerpt – for me.
OR maybe it will notice if you wrote an excerpt – add a “continue reading” but if not—no need.
I guess I don’t know EXACTLY what “allows logic if the excerpt is empty or if it is not empty” means.
<txp:cnj_if_excerpt>tag into a form, then anything between the opening and closing<txp:cnj_if_excerpt>tags will only show up when the article has an excerpt. Similarly, anything between pening and closing<txp:cnj_if_not_excerpt>tags will only show up if there isn’t an excerpt.There isn’t anything here which would automatically output a link of any kind; to get what you want, try this in your article list form:
<txp:cnj_if_excerpt><p><txp:excerpt /></p><p><txp:permlink>Read More...</txp:permlink></p></txp:cnj_if_excerpt>This is one of my favorite plugins…
Subscribe to this article's comments RSS feed. [ ? ] View Recent Comments across the site. Get a Gravatar.