You are not logged in.
Ever wanted to just ‘feature’ an article or 4 on your home page but still leave it in the article flow for later? Messing around with the Sticky status means complications with extra article tags. Wasting a custom field to mark articles as ‘featured’ seems heavy handed and means you have to train your users to a) put them in, b) find them and remove them when you need to rotate the home page articles.
Lucikly, you can download smd_featured — your one-stop shop for all things featury.
Visit the Content->Featured articles tab and you’ll see a grid of all your articles. Click one. Job done. It’s now tagged as ‘featured’ and you can use the
<txp:smd_featured /> tag to display it wherever you like in your Page template.
Click some more articles. Go nuts. They’ll all be displayed by the tag. If you want to unfeature an article, click its name again and confirm. That’s it.
Except it isn’t of course, because this is an smd plugin :-)
When you feature an article you can click the
[Edit] button next to it and optionally assign a label, along with some titla and description text (Textiled if you prefer). This info is displayable alongside other article tags when you lay your featured blocks out. So you could use the description as lead-in text to entice the reader to click the link and reserve your excerpt/body/custom fields for regular purposes. The label is a great way to group your articles into, say, ‘featured’ or ‘teaser’ groups and pull them out separately. And when you display your articles, the plugin keeps track of which ones you’ve shown so it doesn’t duplicate them later.
On the admin side, with large numbers of articles it can become difficult to find stuff so there’s a search facility and a dropdown so you can filter the list by label. You can find out more in the help of course. (smd_prefalizer can help you make any hidden prefs you may like to employ).
Works best on TXP 4.3.0 but will work(ish) on 4.20. I hope this proves useful. Share and Enjoy™.
All available versions and changes are listed here. Each entry indexes the relevant post(s) in the thread to learn about the features.
labelattribute bug (both thanks pieman) ; label searches are now exact matches ; added prefs and pagination support for admin side ; added
<txp:smd_if_featured>; added label selection from dropdown during editing (thanks tye)
article()to sidestep individual article context (thanks johnstephens) ; pass
limithas default of 10
<txp:smd_unfeatured />and permitted
timefiltering ; fixed some styling issues
<txp:smd_featured />default sort order now
feat_position asc, Posted desc
section_listin the admin page’s URL to limit the list of featured articles to the given section(s) (thanks mickmelon) ; fixed trim on label attribute (thanks maniqui)
Last edited by Bloke (2011-12-02 13:40:35)
I was just cursing this today… curious to try it out. Thanks!
I think someone had better write a
<txp:smd_sleep /> plugin for Stef!
I think someone had better write a
<txp:smd_sleep />plugin for Stef!
:D But don’t forget the
<txp:smd_wakeup /> for when we need him ;)
Let’s add also
<txp:smd_feature_request />, for when we (and I’m certainly part of the “we”) need Stef to add that feature that he forgot (how could he, when his plugins have more features than a swiss army knife made of tiny swiss army knifes?) to add on any of its plugins.
La música ideas portará y siempre continuará
Please don’t forget the
<txp:smd_saved_my_as%$%_again/>, for all of those times you needed a plugin —- thought there was not one and then in a last ditch search discovered Stef had one or even better yet looked at one of Stef’s prolugins — needed it tweaked for your project — and the master delivered —-
<txp:smd_we_love_stef />. And I’m serious :)
Feckin ace. Something like this has been on my wishlist for a long time.
<TXP:SMD_UNFEATURED /> is the icing on the cake.
Stef, I’m kicking it around and among all the overall brilliance I found a few unexpected behaviours…
In Mac / Safari Version 4.0.4 (5531.21.10), selecting a label in the Article live search filter wonks the page out.
“Safari is no longer responding because of a script on the webpage ‘Txp › Stuart Charlton › Featured articles’ (http://local.stuartcharlton.com/textpattern/index.php). Do you want to stop running the script, or let it continue?”
Similar effects in Chrome (although if you choose to “wait” for the script it kicks in eventually). No such problems in Mac / Firefox 3.5.9
If no featured articles are labelled, and if the
label attr is unset, both featured and not-featured articles are displayed. I suppose this is an unlikely use case, but if you didn’t need multiple types of featured articles it would be easier not to bother with labeling for categorisation (although you might want to use the label field simply for output with
I get an error when trying
Tag error: <txp:smd_featured wraptag="dl" limit="10" sort="id"> -> Textpattern Warning: Column 'id' in order clause is ambiguous
SELECT *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod FROM textpattern AS txp LEFT JOIN smd_featured AS smdfeat ON txp.ID=smdfeat.id WHERE 1=1 AND Posted <= now() AND Status in (4,5) ORDER BY id LIMIT 10 on line 85
There doesn’t seem to be a default value for
limit – when unset I thought it would spew 10 like
txp:article but I get the full whack