Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#85 2010-12-27 12:53:33

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

Re: smd_thumbnail: manage multiple thumbnails of your images

debeljko

You normally get an unknown image error if you have no thumbnail assigned to an image. I am going to make some assumptions:

1) You have added at least one smd_thumbnail profile
2) You have set one of the profiles as default
3) While smd_thumbnailhas been active you have uploaded images to the category listed in the ‘Galerija’ custom field, or you have clicked ‘Create all’ from the smd_thumbnail control panel

Assuming all the above have been satisfied, you should try to either alter the quotes around the category attribute so the TXP parser is told that you have a tag nested inside:

<txp:smd_gallery category='<txp:custom_field name="Galerija" />' limit="500"><txp:smd_thumbnail link_rel="prettyPhoto" link="1" /></txp:smd_gallery>

OR, you use the smd_gallery shorthand:

<txp:smd_gallery category="?galerija" limit="500"><txp:smd_thumbnail link_rel="prettyPhoto" link="1" /></txp:smd_gallery>

Both of those should work the same way (notice I’ve used lower case ‘galerija’ — that’s the usual way to do it, but it may need to be defined with the capital G. Try it and see. Usually, TXP converts the names to lower case (internally) when you set the custom field up).

jstubbs

You need to alter the order of the <txp:smd_if_thumbnail> and <txp:images> tags again — the test for a thumbnail needs to occur inside the images tag — otherwise it just shrugs its shoulders and goes “huh? what images?” and warns you. This should work:

<txp:article limit="100">
<txp:if_individual_article>
	<txp:output_form form="portfolio_gallery" />
<txp:else />
	<div class="portfolio">
		<txp:permlink class="portfolio_item">
			<txp:if_article_image>
				<txp:images break="">
					<txp:smd_if_thumbnail type="large">
						<txp:smd_thumbnail type="large" />
					</txp:smd_if_thumbnail>
				</txp:images>
			</txp:if_article_image>
		</txp:permlink>
		<txp:excerpt />
	</div>
</txp:if_individual_article>
</txp:article>

Last edited by Bloke (2010-12-27 12:54: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

#86 2010-12-28 11:41:18

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: smd_thumbnail: manage multiple thumbnails of your images

Hi Stef, just tried your code in debugging and testing mode and the error message disappeared as you said it would. Yay! Thanks!

Offline

#87 2011-01-05 17:46:05

des
New Member
Registered: 2011-01-05
Posts: 3

Re: smd_thumbnail: manage multiple thumbnails of your images

Is there way to use this plugin with the lam_image_uploader plugin? I like uploading my images through the write tab as I’m typing, but the thumbnail sizes I need aren’t being created when I upload that way now.

Offline

#88 2011-01-12 12:18:10

jpdupont
Member
Registered: 2004-10-01
Posts: 752

Re: smd_thumbnail: manage multiple thumbnails of your images

Hello Steff,
have you some plan to address this thumbnail creation problem … soon ?

Each time I upload 30, 40 , 50 new images, I must rebuild 200, 230, 270, 320 thumbnails x nbr of profiles :-(((

Thanks !

Last edited by jpdupont (2011-01-12 13:25:44)

Offline

#89 2011-01-12 13:11:37

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

Re: smd_thumbnail: manage multiple thumbnails of your images

jpdupont wrote:

have you some plan to address this thumbnail creation problem

Planned: yes
Implemented: partially

I have converted the ‘Create all’ button to ‘Create’ and added a select list nearby with the following options:

  • All
  • With selected
  • By category
  • By author

Currently, ‘all’ and ‘with selected’ work, so you can use the built-in checkboxes (and all/none/range) to choose the images you want to affect and then apply the thumbnails only to that subset of images. Next job is to do the category and author selects. Then I have to implement the global setting that maniqui asked for and we’re good for the next release.

I’ll try and have a working version out next week. Poke me if it doesn’t appear.

Last edited by Bloke (2011-01-12 13:11:55)


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

#90 2011-01-12 13:16:05

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

Re: smd_thumbnail: manage multiple thumbnails of your images

des wrote:

Is there way to use this plugin with the lam_image_uploader plugin

Sadly no. This plugin only currently works on the Images tab. I don’t know if the two can be integrated (and don’t have a copy of lam_image_uploader to look at the code — the download doesn’t work any more). If someone could send me the plugin I can take a peek, but no promises.


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

#91 2011-01-12 13:27:36

jpdupont
Member
Registered: 2004-10-01
Posts: 752

Re: smd_thumbnail: manage multiple thumbnails of your images

:-)))))))))))))))))))))

Last edited by jpdupont (2011-01-12 13:28:12)

Offline

#92 2011-01-16 07:46:03

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: smd_thumbnail: manage multiple thumbnails of your images

Having a small issue with existing images – when a user changes an already existing image. There are two smd_thumbnail profiles and both are active, set to keep TXP thumbnails in sync with default profile on creation.

When the user edits the photo, the thumbs appear correctly in the individual image tab, but on the public side the result is a 404 – not sure why. If I recreate the thumbnails the image is displayed correctly on the public side. Odd!

Offline

#93 2011-01-16 13:50:59

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

Re: smd_thumbnail: manage multiple thumbnails of your images

jstubbs wrote:

When the user edits the photo, the thumbs appear correctly in the individual image tab, but on the public side the result is a 404

Very confusing. I can’t replicate the 404 behaviour here. I’ve tried replacing an individual thumbnail, the default thumbnail, the entire image, and just altering some text (e.g. the caption) on an image. Each time I refresh the public side I see the correct thumbs (I’m using <txp:smd_thumbnail /> and <txp:article_image thumbnail="1" />) except when I replace the individual thumbnail of the default profile. If I do that then the TXP thumb remains at the old thumbnail. This is a bug, but it doesn’t result in a 404, just a stale thumbnail being displayed.

Hmmmm. I wonder why you’re getting a 404. It could be related to the odd behaviour when replacing a thumbnail. I’ll look into fixing that. In the meantime if you can show me some code to allow me to replicate your setup on my server (perhaps it’s the way your conditionals are set up which is breaking the logic, assuming this is the same code you posted earlier on this thread?) or you can tell me exactly how the user is editing the photo (reupload of main image, changing alt/caption, just uploading a new thumb, etc) then it might help me track this down. Ta!


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

#94 2011-01-17 15:45:15

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: smd_thumbnail: manage multiple thumbnails of your images

Hey Stef. Not sure of the exact method the client is using, but here is the code used for the individual pages. You can see the result in the URL I sent you by email.

<txp:if_article_image>	
	<txp:images break="">
    	<li><a class="thumb" name="<txp:image_info type="name" />" href="<txp:image_url />" title="<txp:image_info type="name" />"><img src="<txp:image_url thumbnail="1" />" alt="<txp:image_info type="alt" />" /></a>
			<div class="caption">
				<div class="image-desc"><txp:image_info type="caption" /></div>
			</div>
		</li>
    </txp:images>
</txp:if_article_image>

Not sure what’s going on here. I did try several alternatives, but no cigar.

Offline

#95 2011-01-21 07:23:30

jpdupont
Member
Registered: 2004-10-01
Posts: 752

Re: smd_thumbnail: manage multiple thumbnails of your images

… I’ll try and have a working version out next week. Poke me if it doesn’t appear. …

Hello Stef !
With the big good news for TXP5, not the time to release the new working version ?

Jean-Pol

Offline

#96 2011-01-21 14:53:37

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

Re: smd_thumbnail: manage multiple thumbnails of your images

jpdupont wrote:

With the big good news for TXP5, not the time to release the new working version ?

On the contrary actually. I had a working version last Sunday which I mailed out to a few people. Had one response back so far (it works, yay!) but I was waiting for the others in case I missed something.

Tell you what, drop me an e-mail and I’ll send you back a copy of what I have so far and you can see if it works for you.


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