Textpattern CMS support forum

You are not logged in. Register | Login | Help

#101 2010-12-18 20:42:53

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

Re: soo_image: simple yet powerful image tags

Either of the solutions I gave above would work for this. I’m thinking about adding a soo_if_image_count tag, but it’s a more interesting problem than it might seem to come up with a good robust tag. Meanwhile:

Solution 1

<txp:soo_image_select form="blank" listform="thumbnails" />

Then the thumbnails form contains what you had in the tag:

<div id="single-item-thumb">
<txp:soo_image thumbnail="1" link_to='<txp:page_url type="s" />/<txp:url_title />' />
</div>

(Note the single quotes for the link_to attribute, and hence the double quotes for the type attribute.)

And make a form called blank, leaving it empty.

Solution 2

<txp:variable name="num_images"><txp:php>
	global $thisarticle;
	echo count(do_list($thisarticle['article_image']));
</txp:php></txp:variable>
<txp:soo_image_select>
	<txp:if_variable name="num_images" value="1">
	<txp:else />
		<div id="single-item-thumb">
		<txp:soo_image thumbnail="1" link_to='<txp:page_url type="s" />/<txp:url_title />' />
		</div>
	</txp:if_variable>
</txp:soo_image_select>

Code is topiary

Offline

#102 2010-12-18 23:44:05

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

Re: soo_image: simple yet powerful image tags

Version 1.0.b.8 available.

  • soo_image_select, when used without selection attributes (id, category, etc.) and outside article context will now check for global image-category context. †
  • New conditional tag, soo_if_image_count. Allows checking the image count in (in order of priority):
    • soo_image_select tag or form
    • article images when in article context
    • images in global image-category context †

So, Tom, you could now do this:

<txp:soo_if_image_count min="2">
	<txp:soo_image_select>
		<div id="single-item-thumb">
		<txp:soo_image thumbnail="1" link_to='<txp:page_url type="s" />/<txp:url_title />' />
		</div>
	</txp:soo_image_select>
</txp:soo_if_image_count>

Global image-category context available only in Txp 4.3.0 or later.

Last edited by jsoo (2010-12-19 15:46:06)


Code is topiary

Offline

#103 2010-12-19 10:47:12

inkywillow
Member
From: France
Registered: 2009-12-22
Posts: 37
Website

Re: soo_image: simple yet powerful image tags

Wow! What a response, thank you!

I’m still on Txp 4.2.0 for this website so I won’t be able to use the new version which is a shame because it looks great. Starting with my next project I’ll be using Txp 4.3.0. so I’ll definitely add this to the armory :)

I’m just about to have a play with the earlier solutions now so I’ll keep you posted.

Thanks again for your hard work…

Tom


The Design Works – Freelance website designer

Offline

#104 2010-12-19 10:54:25

inkywillow
Member
From: France
Registered: 2009-12-22
Posts: 37
Website

Re: soo_image: simple yet powerful image tags

Solution 1 worked a treat, well done you! :D


The Design Works – Freelance website designer

Offline

#105 2010-12-19 14:36:57

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

Re: soo_image: simple yet powerful image tags

inkywillow wrote:

I’m still on Txp 4.2.0 for this website so I won’t be able to use the new version which is a shame because it looks great. Starting with my next project I’ll be using Txp 4.3.0. so I’ll definitely add this to the armory :)

Heh, I should have tested the new version under Txp 4.2.0. No, scrub that — 1.0.b.8 is Txp-4.2.0 compatible.

Last edited by jsoo (2010-12-19 14:52:17)


Code is topiary

Offline

#106 2010-12-19 15:02:04

inkywillow
Member
From: France
Registered: 2009-12-22
Posts: 37
Website

Re: soo_image: simple yet powerful image tags

Blimey, you don’t hang about do you? ;-)

You can see it in action here http://gideonzadoks.com/

Obviously not finished yet but your bit is working OK! See Furniture —> Item1

Thanks again for you help… (let me know your pp details, I think a donation is in order come payday)


The Design Works – Freelance website designer

Offline

#107 2018-05-23 12:23:57

lythande
Member
Registered: 2009-09-08
Posts: 193
Website

Re: soo_image: simple yet powerful image tags

Hi,

i have made a new-install of Textpattern 4.7.0 and install the Plugin soo_image (Version 1.0.b.9)
I getting the error:
A problem occurred while loading the plugin: soo_image -> User_Error: Unable to include plugin {$name}. on line 1420

Last edited by lythande (2018-05-23 12:31:56)

Offline

#108 2018-05-23 12:43:04

lythande
Member
Registered: 2009-09-08
Posts: 193
Website

Re: soo_image: simple yet powerful image tags

Oh, my wrong. I forgotten to install the soo_txt_obj, which soo_image need as requirement… Sorry, now the error is away :-)

Offline

Board footer

Powered by FluxBB