Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2010-09-28 19:49:47

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

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

the_ghost wrote:

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

No need


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

#14 2010-09-28 19:54:16

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

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

Bloke wrote:

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:

Interesting example.
I suppose the standard article_img tag will output nothing if it encounters a category name?!

Offline

#15 2010-09-28 20:13:20

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

masa wrote:

I suppose the standard article_img tag will output nothing if it encounters a category name?!

Actually, no, it will output an img tag with an invalid src attribute.


Code is topiary

Offline

#16 2010-09-28 20:16:32

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

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

Oh pants, maybe it won’t work then, sorry for getting your hopes up. Just threw it out there without trying it.

bad dev *spank*

Last edited by Bloke (2010-09-28 20:16:45)


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

#17 2010-09-28 20:20:51

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

the_ghost wrote:

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

Bloke wrote:

No need

Do you have to do something to your image library to get it to output height and weight attributes with the thumbnail tag, or are there flags in the tag itself?

Offline

#18 2010-09-28 21:17:52

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

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

johnstephens wrote:

Do you have to do something to your image library to get it to output height and weight attributes with the thumbnail tag, or are there flags in the tag itself?

By default it’ll output width= and height= attributes in the <img> tags. You can now override that with width and height attributes on the txp:thumbnail (as of r3411), txp:image and txp:article_image tags. Thus you can force the dimensions if you wish, or let the borwser scale one or both of the dimensions. width="0" or height="0" will omit the output of that particular value and let the browser scale the dimension instead of reading it from the database.


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

#19 2010-09-28 21:25:54

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

Bloke wrote:

By default it’ll output width= and height= attributes in the <img> tags. You can now override that with width and height attributes on the txp:thumbnail (as of r3411), txp:image and txp:article_image tags. Thus you can force the dimensions if you wish, or let the borwser scale one or both of the dimensions. width="0" or height="0" will omit the output of that particular value and let the browser scale the dimension instead of reading it from the database.

I must have done something wrong. I’m looking at output from txp:thumbnail and it includes only src, alt, and title— no width or height. I thought I might have to go into the image tab and re-save each thumb to get the heights and widths in the database, or something like that.

Also, offset doesn’t seem to work work when using image_list in an article form when the article image contains comma-separated image ids; I get the same image list with or without offset. Is that correct, or have I done something wrong?

Offline

#20 2010-09-28 21:31:50

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

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

johnstephens wrote:

I thought I might have to go into the image tab and re-save each thumb to get the heights and widths in the database, or something like that.

Ah yes, you do. Sorry, I’m being a dimwit tonight. If you don’t have thumbnails assigned, the database won’t have a record of their dimensions so you’ll get nothing out by default. But you can still force the size with the width and height attributes.

Also, offset doesn’t seem to work work when using “image_list”

Hmmm, I’ll look into that. Thought I tested it, but maybe it fell by the wayside somehow. I’ll see if I can test that particular functionality later.

Last edited by Bloke (2010-09-28 21:32:09)


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

#21 2010-09-28 21:40:48

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

johnstephens wrote:

I thought I might have to go into the image tab and re-save each thumb to get the heights and widths in the database, or something like that.

Bloke wrote:

Ah yes, you do. Sorry, I’m being a dimwit tonight. If you don’t have thumbnails assigned, the database won’t have a record of their dimensions so you’ll get nothing out by default. But you can still force the size with the width and height attributes.

What’s the bounty on a script that can update your textpattern’s image table to include the height & width information without manually re-saving each one? ;)

johnstephens wrote:

Also, offset doesn’t seem to work work when using “image_list”

Bloke wrote:

Hmmm, I’ll look into that. Thought I tested it, but maybe it fell by the wayside somehow. I’ll see if I can test that particular functionality later.

My thought was that the image ids of the Article Image field were overriding the offset.

Thanks for the awesome release candidate, BTW.

Offline

#22 2010-09-28 21:44:16

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

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

johnstephens wrote:

Also, offset doesn’t seem to work work when using “image_list”

Try adding a limit as a stop-gap. The problem is that by default the limit is 0 (“all”) which for reasons of vagaries in the code (line 2950 of taghhandlers.php) won’t actually trigger the offset to fire in the SQL. That should probably be changed but I think I tried it before and it fell apart under certain conditions. I could try again, or maybe someone else has some bright ideas.


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-28 21:47:16

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

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

johnstephens wrote:

What’s the bounty on a script that can update your textpattern’s image table to include the height & width information without manually re-saving each one? ;)

Free if you use smd_thumbnail :-)

Well, to be fair, it doesn’t update the TXP thumbs in the database but it creates as many new thumbs of arbitrary dimensions as you care to define. If you define just one you get the same functionality as TXP now. But there’s a natty Create All button in the plugin for just this situation.


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-28 22:03:27

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

johnstephens wrote:

What’s the bounty on a script that can update your textpattern’s image table to include the height & width information without manually re-saving each one? ;)

You can probably afford it:

soo_thumb_atts


Code is topiary

Offline

Board footer

Powered by FluxBB