Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2010-08-19 16:53:55

kemie
Plugin Author
From: mexico<-->sweden
Registered: 2004-05-20
Posts: 495
Website

Re: smd_featured: Quickly pull articles to your home / landing pages

ok, strange.
<txp:smd_featured form=“home_listing” limit=“3” />
<txp:smd_featured form=“home_listing” limit=“3” />
that is, putting the tag two times, produces 3 non-featured articles, followed by 3 featured articles. is this not meant as a self-closing tag too?

Last edited by kemie (2010-08-19 16:58:55)


~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~

Offline

#14 2010-08-23 05:10:30

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

Re: smd_featured: Quickly pull articles to your home / landing pages

  1. I featured one article.
  2. I set the tag to display one article.
  3. I then added a second article to the featured list.
  4. I removed the first article.
  5. The first article continued to show even after it was de-selected.
  6. I refreshed the browser several times. No luck.

Am I missing something obvious?

Thanks

Mike

Offline

#15 2010-08-24 09:15:01

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,436
Website GitHub

Re: smd_featured: Quickly pull articles to your home / landing pages

kemie

Thanks for the report. I’ll look into that. Sounds like a bug which I may have squished as part of the rewrite in response to pieman’s findings. I’ll check I’ve covered this example.

Just out of curiosity, why are you displaying two blocks like that? Are you splitting the featured articles around some other content? (which is a perfectly legitimate use case). In theory it should pick three featured articles in the first tag, and then pick three more from the second that have not been used already. Does it work if you assign a label to the articles and specify that label in your smd_featured tags? I think this may be the ‘unlabelled’ bug that pieman found and I’ve since fixed.

maverick

Doesn’t sound like you’re missing anything. It should remove the original article, hmmm. Just for clarification, when you say “I removed the first article” in step 4, do you mean you unfeatured it from the Featured articles tab or actually deleted the entire article from the Articles tab? That raises a good point: I’d better check what happens when you do delete an article from TXP entirely. Thanks for the nudge!

all

I have actually finished the new version (the above two caveats notwithstanding) and it now:

  • supports pagination if you prefer
  • uses a non-live search for people with truckloads of articles (when using pagination mode)
  • exposes some of the hidden prefs on the plugin tab for ease of access
  • adds <txp:smd_if_featured> which is remarkably handy in a <txp:article> form to take action if one of the articles in the list is in your featured list
  • sorts out the bugs pieman found

The only thing stopping me releasing it right now is that I used the plugin to try out an experimental feature of the core’s get_pref() function. I’m waiting to see if Robert / Sam think it’s a good idea to introduce this change to help plugins under these specific circumstances. If not, I’ll have to write some extra code to work around it, which is not a major hardship but it’s extra code I’ll have to repeat… and I hate repeating code.

In fact, the plugin works as is and will even run on 4.2.0; it just means that when you set prefs you have to refresh the page for the changes to take effect, which is not very friendly. So if anybody would like to try this unofficial version out, get in touch. In the meantime I’ll have a look into the problems above and see what the status is.

Last edited by Bloke (2010-08-24 12:57:57)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#16 2010-08-24 12:37:34

kemie
Plugin Author
From: mexico<-->sweden
Registered: 2004-05-20
Posts: 495
Website

Re: smd_featured: Quickly pull articles to your home / landing pages

Hi Bloke, the only reason I output 2 blocks was for testing reasons, I tested out the tag with different parameters, and found that the second tag *always¨had the right output even if they were identical. I’ll try the label thing.

thanks!


~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~

Offline

#17 2010-08-24 12:53:18

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

Re: smd_featured: Quickly pull articles to your home / landing pages

Bloke wrote:

do you mean you unfeatured it from the Featured articles _ tab or actually deleted the entire article from the _Articles tab?

Glad to be inspirational, sorry I was clear as mud!

I meant that I was unselecting it as a featured article in the featured article tab. But the display remained, despite forcing it to load fresh and not from the cache.

Thanks

Mike

Last edited by maverick (2010-08-24 12:54:43)

Offline

#18 2010-08-24 13:44:02

kemie
Plugin Author
From: mexico<-->sweden
Registered: 2004-05-20
Posts: 495
Website

Re: smd_featured: Quickly pull articles to your home / landing pages

confirmed,
<txp:smd_featured form=“home_listing” limit=“3” label=”“ />
is returning 3 featured, unlabeled articles.

but I’d love to include both labeled and unlabeled articles, just the latest 3 (being picky here, it works ok as is)

thank you!


~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~

Offline

#19 2010-08-24 14:06:41

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,436
Website GitHub

Re: smd_featured: Quickly pull articles to your home / landing pages

kemie wrote:

confirmed, <txp:smd_featured form=“home_listing” limit=“3” label=”“ /> is returning 3 featured, unlabeled articles.

Good, thanks for testing. At least you have a way to do what you want for now.

but I’d love to include both labeled and unlabeled articles, just the latest 3

I just checked and the next version does indeed do this:

<txp:smd_featured limit="3" />    Displays up to 3 featured articles, with or without labels assigned
<txp:smd_featured limit="3" label="" />    Displays up to 3 unlabelled articles
<txp:smd_featured limit="3" label="myLabel" />    Displays up to 3 articles assigned to myLabel

maverick

No idea what happened to your site here. I just ran through your steps with the next version of the plugin and it’s fine so the chances are it’s a random bug in the first version or something browser or cache-related despite the refresh (which I assume you forced to flush the cache?)

Incidentally, deleting an article doesn’t currently remove it from the featured table, although it does no harm because you never see the article again so the fact there’s an entry for a non-existent article is neither here nor there. For completeness I should probably look into tidying the table though; I’ll see what I can do.

Last edited by Bloke (2010-08-24 14:07:16)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#20 2010-08-24 15:21:15

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

Re: smd_featured: Quickly pull articles to your home / landing pages

Bloke wrote:

which I assume you forced to flush the cache?

Yes.

No problem – I’ll await the next version, and keep experimenting in the mean time :)

Thanks Bloke!

Mike

Offline

#21 2010-09-07 04:15:03

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: smd_featured: Quickly pull articles to your home / landing pages

Sir Stef, this is a superb addition, thanks :)

One possible improvement request/idea for this…. maybe the labels could be setup separately (to the side under the search) and then selected via a dropdown when selecting a featured article to avoid misspellings, caps, no caps etc.

Just a thought

Offline

#22 2010-09-07 07:53:08

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,436
Website GitHub

Re: smd_featured: Quickly pull articles to your home / landing pages

tye wrote:

maybe the labels could be setup separately (to the side under the search) and then selected via a dropdown when selecting a featured article to avoid misspellings, caps, no caps etc.

That’s a good idea. I think I considered that a while ago and then promptly forgot about it d’oh.

As an alternative, perhaps when editing an entry I could present the current label list as well as the textbox so you can either choose one from the dropdown or type a new one in. Would that help? Since the plugin currently has a separate step for editing this is probably the cleanest way to do things.

If I’d been more clever from the outset I could have put the labels in the boxes and allowed you to alter them directly in the list view, but I guess that adds extra weight to the already heavy page. Since I’ve not released the new version yet (though it’s ready) I could try and sneak this request in first. Thanks.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#23 2010-09-07 16:01:45

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,436
Website GitHub

Re: smd_featured: Quickly pull articles to your home / landing pages

v0.20 is out. Features:

  • added prefs and pagination support for admin side
  • added label selection from dropdown during editing (thanks tye)
  • added <txp:smd_if_featured>
  • renamed id column to feat_id so you can now correctly sort by ID (thanks pieman)
  • fixed label attribute bug (thanks pieman)
  • label searches are now exact matches

IMPORTANT

One thing to be aware of: under TXP 4.2.0 if you change any of the prefs you need to reload the plugin tab (just click it) to actually see them take effect. If you are running the latest SVN your changes will occur instantly because the plugin uses a new feature of 4.3.0 if it finds it available.

Hope this version improves the experience for you all. And thanks for your patience while I got it all patched up and working.

Last edited by Bloke (2010-09-13 14:31:35)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#24 2010-09-07 16:09:32

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

Re: smd_featured: Quickly pull articles to your home / landing pages

Bloke wrote:

And thanks for your patience while I got it all patched up and working.

To be fair, it was hard work – all that sitting around waiting for you to do stuff for other people’s benefit ;-)

Offline

Board footer

Powered by FluxBB