Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#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: 12,459
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.

Hire 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: 12,459
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.

Hire 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: 12,459
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.

Hire 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

#25 2010-09-07 17:27:59

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

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

Yea, I also had to procrastinate loaaads while waiting for this plugin :D

thanks Stef, much appreciated!


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

Offline

#26 2010-09-07 23:52:21

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

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

Stef – do you wear a cape in normal life?

It’s less than 24hours since I made that suggestion :)

Thanks again :)

Offline

#27 2010-09-13 02:42:47

bg
Member
From: Pekin Illinois USA
Registered: 2005-02-20
Posts: 22
Website

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

Hey Sir Bloke! I love this plugin, but I’ve managed to get lost trying to use it.

Okay, maybe I’m just not seeing it after going cross-eyed over this for almost a week, so here’s my….

Question:
Is there a bullet-proof way to disable Textile for the Description field without having to begin the Description with “notextile. “? I’m trying to build a display form that will use the entire Description field (it’s only 18-20 words) as link text. Here’s my display code…

<txp:permlink><txp:smd_featured_info item="description" /></txp:permlink>

… and of course, when Textile is active, this breaks the HTML by placing the link code outside the paragraph markers.

Some of the time — not always … not even often! — I remember to begin with “notextile. “ in the Description field. But I know that when I tell the non-coders who contribute to the site how to use this Featured feature, they will botch it almost always.

Any thoughts?

And now a request:

Is it possible to add a third field to the plugin data? Maybe “Label_2” or some such? I’d like to use that field as an alternate title when I display the Feature Box. I’ve developed a work-around by using a custom field for this, but for various reasons that’s going to become unsatisfactory in the near future.

This is probably not something that I could hack into the plugin because I’m nowhere near a mySQL geek and just barely manage to get by with minimal PHP knowledge.

TIA for all replies!

Peace,

Last edited by bg (2010-09-13 02:43:06)


— Bob

Offline

#28 2010-09-13 12:09:55

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,459
Website GitHub

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

bg wrote:

Is there a bullet-proof way to disable Textile for the Description field

After donning my cape this morning for an hour or so, there is now. Two new features:

  1. Added a pref option to allow you to turn Textile on or off
  2. Added a ‘Title’ entity (which is also Textilable if you wish) to save having to use up a custom field. A second field always comes in handy, right?

Thanks for the ideas.

Let me know how y’all get on with this. Upgrades should be smooth and just add the relevant fields automatically (unless you’re using the plugin cache directory, in which case you’ll be prompted to upgrade). But, as always, please backup first just in case the Pope’s UK visit disrupts the space-time continuum at the moment you click install.

Have fun.

Last edited by Bloke (2010-09-13 12:12:33)


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

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#29 2010-09-13 12:24:27

bg
Member
From: Pekin Illinois USA
Registered: 2005-02-20
Posts: 22
Website

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

Stef, this is absolutely mahhh-velous! I’m going to install the upgrade momentarily.

It’s hard to believe your zippy response. Perhaps we do need an smd_bloke_sleeps plugin, since the smd_bloke_plugin_request works so well.

Thanks again for the quick reply. I’ll let you know if there’s any problem with the upgrade (though I doubt there could be).

Peace,


— Bob

Offline

#30 2010-09-13 14:22:25

bg
Member
From: Pekin Illinois USA
Registered: 2005-02-20
Posts: 22
Website

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

Here’s a follow-up report on the update, Bloke. Seems to be a bit quirky and I haven’t been able to isolate a specific sequence of actions that produces the quirks. But here they are…

BTW, I’m using Textpattern v4.2.0 and the server is running Apache 2.2.16 with PHP 5.2.14 and mySQL 5.0.91. My platform is Mac OSX 10.4.11. Browsers are Camino and Safari (haven’t tried with Firefox).

1 – Using the Control Panel to turn Textile off (or back on) doesn’t always seem to work. Sometimes it does. Sometimes it doesn’t. Even when the tick-boxes show no tick, Textile still seems to process the fields (when the quirk occurs). And occasionally, vice-versa. Clearing browser cache has no effect; nor does quitting and restarting the browser. Clicking the “Featured Articles” tab doesn’t always work consistently, either.

2. Saving changes in the Control Panel requires performing the actions twice. Open CP; click the box; hit “Save” produces no change the first time… box returns to its original state. Click the box and hit “Save” again and the box tick-mark will change, but only on this second attempt.

3. Editing an article’s attributes (Title, Description or Label) from the grid often produces an SQL error. Sometimes this happens when both the article edit box and the Control Panel are both open at the same time. Sometimes happens when only the article edit box is open. Or when only the CP is open!

4. And last but not least… Not all of the Featured articles are processed the same way on the web page! Sometimes (but only occasionally) one of the changes I’ve attempted to make will “stick” and the article will display as I want it to. But other articles (I’m using a rand() sort for testing, then displaying one article at a time) don’t render the same way.

Confusing, huh? Boy howdy you betcha! You can see what’s happening on the page at…

http://stjosephpekin.org/test/

The top image banner and text (immediately below the masthead) are rendered using smd_featured. Refresh the page to run through the random sequence. There are five articles in the series. At the present time these are set for Textile off for both the title and description fields. But as you’ll see, Textile sometimes adds it’s little paragraph markers anyway! The article with the squirrel photo renders the headline properly, but the others do not; Textile adds its little <p> tags! And the copy in the Description field seems always to get Textile’s <p> tags.

Duhhhh… yeah, I be snockered by this one because it’s not always consistent. Any thoughts?

BTW, here’s the text message the SQL error produces (this was generated with Textile still turned “on” for the Description field)…

Warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘s Tootsie time again and our Knights need volunteers to sell ‘em. Can you help? ‘ at line 1 update smd_featured set label=‘Featured’, feat_title=‘Please Help!’, feat_title_html=‘Please Help!’, description=‘notextile. It\‘s Tootsie time again and our Knights need volunteers to sell \‘em. Can you help? Please click…’, desc_html=‘notextile. It’s Tootsie time again and our Knights need volunteers to sell ‘em. Can you help? Please click…’ where feat_id=‘94’ in /home/stjoseph/public_html/textpattern/lib/txplib_db.php on line 85

And here’s the code from the form that renders the output…

<h1><txp:smd_featured_info item=“title” /></h1>

<p>
<txp:permlink><txp:smd_featured_info item=“description” /></txp:permlink>
</p>

Thanks for your help!

Peace,

Last edited by bg (2010-09-13 14:30:26)


— Bob

Offline

Board footer

Powered by FluxBB