Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#121 2008-06-09 15:54:35

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

Re: smd_gallery: super-flexible gallery generator

robin746 wrote:

(Is this supposed to be an article or misc form? I have tried both.)

It doesn’t matter. The types are just ways of grouping them on the right side of the screen (I believe).

With regards the code, it looks like you’ve not missed anything. You will, however, need to add thumbchange="" to the tag because it defaults to category. Since you’re using and sorting by IDs you’ll need to turn off the auto-watching of changes in category or you’ll get all manner of odd thumbnails popping out. I’ll have to highlight that in the example, sorry I missed it when I updated the docs.

As to why you’re getting no output at all, hmmm, upm_if_article_image should be passing ok, unless you’re in an article list and the code is on your Page template, in which case it’ll not fire (and if you’re in debugging mode it should issue a warning I believe). Put the site in debugging mode and look at the tag trace at the bottom of the source. Find the upm_if_article_image and check to see if it says true after its closing tag.

I’ve tested this on my site by putting your exact smd_gallery tag (plus the required thumbchange="") into an article and putting a comma-separated list of images in the article image. It makes all the right noises in the page source so this one’s got me flummoxed.


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

#122 2008-06-09 16:21:05

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

Re: smd_gallery: super-flexible gallery generator

immarabi wrote:

So without the www in the Admin> PReferences… the slideshow doesn’t work when you type in www in the address bar.. and with the www in Admin > Preferences and a different .htaccess the slideshow works in IE both ways but doesn’t work in Firefox without the www and I get this error: Access to restricted URI denied” code: “1012

Sounds like a definite case of .htaccess blues. Maybe the slideshow script is doing some javascipt jiggery pokery that relies on the URL being the same as the one that loaded the script? (stab in the dark)

Sadly, it’s beyond my realm of understanding — .htaccess is still voodoo to me — but may I suggest taking a look through aeron’s wall to see if anyone’s posted about it before? Perhaps someone there might be able to shed some light on this odd error message.


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

#123 2008-06-09 17:08:55

robin746
Member
From: Ireland
Registered: 2007-09-22
Posts: 113
Website

Re: smd_gallery: super-flexible gallery generator

Bloke wrote:

As to why you’re getting no output at all, hmmm, upm_if_article_image should be passing ok, unless you’re in an article list and the code is on your Page template, in which case it’ll not fire (and if you’re in debugging mode it should issue a warning I believe). Put the site in debugging mode and look at the tag trace at the bottom of the source. Find the upm_if_article_image and check to see if it says true after its closing tag.

This results in:

 <txp:output_form form="r-coverimage" />
	[SQL (0.000046): select Form from ch_txp_form as txp_form where name='r-coverimage']
	[Form: r-coverimage]
	<txp:upm_if_article_image>
		[<txp:upm_if_article_image>: true]
		<txp:smd_gallery id="?article_image" form="r-gallery" thumbchange="" thumbsize="270, 200" thumblimit="1" sort="fixed" />
			[SQL (0.000071): select Form from ch_txp_form as txp_form where name='r-gallery']
			[Form: r-gallery]
			[SQL (0.000067): select txp_image.name,txp_image.id,txp_image.alt,txp_image.caption,txp_image.category,txp_image.author,txp_image.date,txp_image.ext,txp_image.w,txp_image.h,txp_image.thumbnail from ch_txp_image as txp_image where 1=1 AND  (txp_image.id IN ('70','61','62'))  LIMIT 0,99999]
			[SQL (0.000061): select txp_image.name,txp_image.id,txp_image.alt,txp_image.caption,txp_image.category,txp_image.author,txp_image.date,txp_image.ext,txp_image.w,txp_image.h,txp_image.thumbnail, txp_category.title AS category_title from ch_txp_image as txp_image, ch_txp_category as  txp_category where txp_category.name = txp_image.category AND txp_category.type="image" AND 1=1 AND  (txp_image.id IN ('70','61','62'))  LIMIT 0,99999]
	</txp:upm_if_article_image>

The correct image IDs are being used in the SQL. Looks ok to me. But no output.


robin

Offline

#124 2008-06-09 23:35:17

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

Re: smd_gallery: super-flexible gallery generator

progre55:

Re: Galleria, can I put you in a holding pattern for a little while? I’ll take a look at it and see how it works under the hood so I can work out what the gallery tags need to be. I’m just trying to fix the ‘sort’ bug robin746 found in slimbox that I think manifests itself here too, and also trying to figure out why that gallery tag fails when it works fine on my test server.

But on first glimpse at the page source of the Galleria demo page I would hazard a guess that the reason you’re only seeing a single image is because the plugin is in collate mode and you’re telling it to display image #1 only. Take any reference to #1 out of the form, remove the collate attribute, put a wraptag and break of ul/li respectively and add a class of “demo_gallery” then see if it’s any closer. After that it should just be a case of “starting” the effect if it doesn’t do it automatically.

Last edited by Bloke (2008-06-09 23:36:40)


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

#125 2008-06-10 12:20:51

progre55
Member
Registered: 2006-05-02
Posts: 668

Re: smd_gallery: super-flexible gallery generator

immarabi: I got your email. : ) Unfortunately, I am not sure you will like my answer. My htaccess file is the one that comes with TXP. There is nothing that I modify or change. I also tested the site that I have it working on, without the www, and it works fine so I do not beleieve that it is related to that file.

Bloke No problem. I will continue to do some poking. In fact, I may have a better “problem/issue” to bring you in on, but I want to try several things before turning to the EXPERT … speak to you soon …

progre55

Offline

#126 2008-06-10 16:23:03

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

Re: smd_gallery: super-flexible gallery generator

New version 0.43 | compressed with the following features:

  • Fix the sort="fixed" the same as yesterday’s change in smd_slimbox. Saved a query (save the world?) — thanks robin746
  • Added grouptag and groupclass so jstubbs can wrap his galleries in blocks (see example 6 in the help)
  • Allowed fixed sorting by category as well as ID
  • Renamed all the thumbchange* attributes as onchange* instead. Deprecated the thumbchange* tags but they are still honoured if you use them. Note that this impacts the {changed:} replacement tag. If you use the onchange tags then you must use {onchange:thing}. If you still use thumbchange you must continue to use {changed:thing} but I strongly urge to begin switching over when you get the chance. Saves typing as well :-)
  • Silly bug fix with the {index} counter

See how you get on with this version. As ever, report any successes or otherwise here. I cannot figure out why robin746’s images won’t show up. The only thing I can think is it’s to do with the database prefix, but it looks to be working fine judging by the tag trace. Bizarre.


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

#127 2008-06-10 17:27:33

robin746
Member
From: Ireland
Registered: 2007-09-22
Posts: 113
Website

Re: smd_gallery: super-flexible gallery generator

Bloke wrote:

I cannot figure out why robin746’s images won’t show up. The only thing I can think is it’s to do with the database prefix, but it looks to be working fine judging by the tag trace. Bizarre.

It is odd! I won’t be able to try this out further this time round, but instead will use your other plugin. Very constrained by deadlines.


robin

Offline

#128 2008-06-10 17:42:09

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

Re: smd_gallery: super-flexible gallery generator

Hi Stef,

Afraid I have to report that the latest version resulted in a lot of verbose array errors printed on the screen :-( I have reverted to the previous version 0.42.

No changes were made to any tags.

Offline

#129 2008-06-10 18:17:25

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

Re: smd_gallery: super-flexible gallery generator

jstubbs wrote:

Afraid I have to report that the latest version resulted in a lot of verbose array errors printed on the screen :-(

Sorry, that was me being a total tube and uploading the one from my test server instead of the real plugin. Try now :-)


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

#130 2008-06-10 18:43:08

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

Re: smd_gallery: super-flexible gallery generator

Stef, thanks for the assistance, and your very much appreciated hard work!

0.43 is now working, at least the compressed version. The non-compressed version gave me a badly formed plugin error.

I am trying to figure out how to use your new tag attributes – I have this now in the page:

<div class="contentbox">
<txp:smd_gallery category="STA-Training, STA-Facilities, STA-Players, STA-Staff, STA-On-Tour" wraptag="div" class="thumbs" form="gallery" sort="fixed" grouptag="div" groupclass="box" />
</div>

And this in the “gallery” form:

<txp:if_different>
<h2>{category_title}</h2>
</txp:if_different>
<a href="{url}" title="{title}"><img src="{thumburl}" alt="{alt}" /></a>

How should the new attributes – grouptagstart/grouptagend be used to accomplish what I need?

Offline

#131 2008-06-10 18:56:19

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

Re: smd_gallery: super-flexible gallery generator

jstubbs wrote:

0.43 is now working, at least the compressed version. The non-compressed version gave me a badly formed plugin error.

I expected that. It’s teetering on the edge of 100kb of BASE64 which is approaching the theoretical maximum I think for plugins (no idea the actual value). I’ll have to learn to be more terse in my plugin help ‘cos 65% of that is help text!

How should the new attributes – grouptagstart/grouptagend be used to accomplish what I need?

Look at example 6 in the help for more detail but, in a nutshell, use the new tags in your gallery form like this:

<txp:if_different>
<h2>{category_title}</h2>
</txp:if_different>
{grouptagstart}
<a href="{url}" title="{title}"><img src="{thumburl}" alt="{alt}" /></a>
{grouptagend}

(or use {object} instead of the img). That’ll put <div class="box">...<div> around each block of images every time the category changes. It works without extra options because onchange is set to watch for category changes by default. Every time the category changes to the next one, the grouptags are loaded with the div/class you specified.

Hopefully the sort=“fixed” will maintain your category order too. Fingers crossed, it worked on my setup…

EDIT: and if you want to wrap the entire thing — <h2> and all — just move the {grouptagstart} to the top of the form.

Last edited by Bloke (2008-06-10 18:59:20)


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

#132 2008-06-10 19:08:58

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

Re: smd_gallery: super-flexible gallery generator

Mmm. I now have this:

<txp:smd_gallery category="STA-Training, STA-Facilities, STA-Players, STA-Staff, STA-On-Tour" wraptag="div" class="thumbs" form="gallery" sort="fixed" grouptag="div" groupclass="contentbox" />

And this for the form:

<txp:if_different>
<h2>{category_title}</h2>
</txp:if_different>
{grouptagstart}
<a href="{url}" title="{title}">{object}</a>
{grouptagend}

Not quite working yet – you can see the result

Offline

Board footer

Powered by FluxBB