Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-09-28 11:04:14

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

[howto] Using the new image tags in Txp 4.3.0

I know it’s still at release candidate stage, but I wanted to put 4.3.0’s new image tags through their paces. I’m impressed, and quite expect to dismantle soo_image into one or two small & specialized plugins. Because the new core tags do pretty much everything I need.

Herewith, a demo with code and examples. Pure Txp, no plugins.

Edit, 2011-04-10: new URL

Last edited by jsoo (2011-04-10 16:23:22)


Code is topiary

Offline

#2 2010-09-28 11:41:53

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

Re: [howto] Using the new image tags in Txp 4.3.0

Great idea, great examples! Thanks.

Offline

#3 2010-09-28 11:44:27

candyman
Member
From: Italy
Registered: 2006-08-08
Posts: 684

Re: [howto] Using the new image tags in Txp 4.3.0

I wanted to use soo_image in the past but I waited for this reason: I’m going to wait for the “lite editions” for specialized functions, using the core ones for basic image handling.

Thanks for the demos: very useful

Last edited by candyman (2010-09-28 15:30:56)

Offline

#4 2010-09-28 15:17:36

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

Re: [howto] Using the new image tags in Txp 4.3.0

Niiiiiiice!


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

#5 2010-09-28 16:11:55

masa
Member
From: Asturias, Spain
Registered: 2005-11-25
Posts: 1,091

Re: [howto] Using the new image tags in Txp 4.3.0

Very nice indeed.

Excellent that this is now possible with just the core.

Offline

#6 2010-09-28 16:19:23

keith
Member
From: Blyth, Northumberland, England
Registered: 2004-12-08
Posts: 199
Website

Re: [howto] Using the new image tags in Txp 4.3.0

Crikey!


Keith
Blyth, Northumberland, England
Capture The Moment

Offline

#7 2010-09-28 19:04:23

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: [howto] Using the new image tags in Txp 4.3.0

Question: I note the Photoblog example above assume one image per article. soo_image allows several. Is that possible in TXP 4.3.0, or is that still the domain for a plugin?

Offline

#8 2010-09-28 19:28:35

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: [howto] Using the new image tags in Txp 4.3.0

Yes, image_list understands a comma-separated list in the article-image field. See the demo’s ‘et cetera’ page.

Edit, 2011-04-10: updated URL

Last edited by jsoo (2011-04-10 16:24:18)


Code is topiary

Offline

#9 2010-09-28 19:30:09

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

Re: [howto] Using the new image tags in Txp 4.3.0

johnstephens wrote:

assume one image per article

Officially, the article image field is to hold one ID only. But the <txp:image_list /> tag — without any other selection attributes — will treat the article image field as a comma separated list of IDs if it’s set as such.

Edit: too late :-)

Last edited by Bloke (2010-09-28 19:30:28)


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

#10 2010-09-28 19:36:35

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: [howto] Using the new image tags in Txp 4.3.0

That’s awesome, Jeff. Thanks! (Silly of me not to read et cetera before posting.)

Stef, is that a behavior I can count on for the future? Associating multiple images with an article in this way is very useful. I only ask since you said “officially” the pairing of articles to images is 1:1.

Offline

#11 2010-09-28 19:43:17

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: [howto] Using the new image tags in Txp 4.3.0

Where can we vote for width/height attrs for thumbnails? :)


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#12 2010-09-28 19:48:55

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

Re: [howto] Using the new image tags in Txp 4.3.0

johnstephens wrote:

is that a behavior I can count on for the future?

Yup. The <txp:article_image /> tag will continue to function as it always did only supporting a single image, but it didn’t make sense for <txp:image_list /> to obey the same logic. So I made it understand a list of IDs if they were present (or just a “list” of one image if the article image field was used as in 4.2.0).

If you want any more esoteric functionality like using a list of category names in the article image field, then it’s plugin land or abuse the system with tags-in-tags.

EDIT: stupid, brain-dead code example removed

Last edited by Bloke (2010-09-29 08:12:46)


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

Board footer

Powered by FluxBB