Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#976 Yesterday 10:03:55
Re: smd_gallery: super-flexible gallery generator
It’s probably the plugin using some outdated PHP code. Do you see any errors/warnings if you quickly flick your site into debugging mode?
I fully expect whatever you’re trying to achieve can be done without the plugin now. It might be worth revisiting what layout you’re creating and seeing if it can be converted to core tags.
Happy to help if you need me.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#977 Yesterday 19:15:56
Re: smd_gallery: super-flexible gallery generator
detail wrote #343327:
This is the code where it fails to load any images following the 4.9.1 transition:
<txp:smd_gallery id="?article_image"...Any thoughts would be greatly appreciated. Would like to retain the descriptions, as around 900 images are affected.
Might this approach work:
<txp:images id='<txp:custom_field name="article_image" breakby="@" break="," />'
break="," wraptag="images: [ <+> ]">
{ url: "<txp:image_url />", description: "<txp:image_info />" }
</txp:images>
TXP Builders – finely-crafted code, design and txp
Offline
#978 Today 02:58:40
Re: smd_gallery: super-flexible gallery generator
Bloke wrote #343328:
Stef
Thanks for your interest.
I like doing the “research” for my websites. Not so keen on the coding stuff!
It’s probably the plugin using some outdated PHP code. Do you see any errors/warnings if you quickly flick your site into debugging mode?
Tag error: <txp:smd_gallery id="?article_image"
delim="@" paramdelim="|" collate="1"
combo='sc_img| { url: "{url}", description: "{caption}" }'>
images: [ {sc_img} ],
</txp:smd_gallery> -> Textpattern Warning: smd_gallery tag does not exist while parsing form None on page cta trails 1080
textpattern/lib/txplib_publish.php:543 trigger_error()
textpattern/lib/txplib_publish.php:429 processTags()
textpattern/publish/taghandlers.php:2295 parse()
if_article_list()
textpattern/vendors/Textpattern/Tag/Registry.php:140 call_user_func()
textpattern/lib/txplib_publish.php:540 Textpattern\Tag\Registry->process()
textpattern/lib/txplib_publish.php:429 processTags()
textpattern/lib/txplib_misc.php:3819 parse()
textpattern/publish.php:754 parse_page()
index.php:81 textpattern()
Looks like smd_gallery is not registering with the Txp System Tag Registry. This plugin is switched to Active: Yes.
(This is also the case with the old rss_auto_excerpt, which must have had a bunch of code that worked with my earlier PHP 7.1, but broke when the PHP was upgraded to PHP 8.4 this week.)
I fully expect whatever you’re trying to achieve can be done without the plugin now. It might be worth revisiting what layout you’re creating and seeing if it can be converted to core tags.
I’m obviously able to throw up a single image easily, as no slideshow is involved. The issue is to match the sliding caption that appears when you hover over the image. This example still works because it uses the Page List version of the code. That’s how the Individual Article webpages used to work.
https://cycletrailsaustralia.com/6_bike/
It would be a mission to recreate the sliding caption to match the slideshow. Here’s the slideshow example, you need to see on a laptop or desktop monitor.
https://cycletrailsaustralia.com/
Unfortunately, another of my websites uses the same slideshow system, and that has 1800 pages, most of which would be affected. The captions could be omitted, but that would be a huge loss of information. I’d lose 1790 captions.
I guess this is why I’ve put this off for so long.
Any thoughts after seeing that error message, Stef?
The 12 hour time difference doesn’t make this correspondence flow!
Offline
#979 Today 03:24:58
Re: smd_gallery: super-flexible gallery generator
jakob wrote #343329:
Might this approach work:
<txp:images id='<txp:custom_field name="article_image" breakby="” break=”,” />’…@
Jakob.
Thanks for helping out with this.
Just a clarification here.
There are two different instances.
The multi-image slideshows are working the same as usual, but they don’t use smd_gallery at all. I hard-coded them because these only occur on the article list webpages.
This is an example: https://cycletrailsaustralia.com/
The Individual Articles each have only one image, but I’m using smd_gallery to collate the article images and their captions so they match the slideshows. Almost all pages have just one image, and there are more than 900 pages. None of these is loading.
Stef found that we couldn’t use the usual commas to separate the images, so we used @ instead. I don’t think I have multiple article images, but I could always use limit=“1” to avoid any issues there and avoid using break or breakby at all.
I’ve tried a few variations on the code you suggested, but I might pare it back to just getting the image to load first and adding the caption later. Once the image is showing up. I’ve found other 16-year-old plugins that have also broken, so I have been somewhat distracted here.It’s been 18 months since I last looked at Txp, so there is some head-scratching going on!
Offline
#980 Today 05:00:04
Re: smd_gallery: super-flexible gallery generator
Stef and Jakob
Eureka!!
In the end, after comparing the syntax of what was working in the hard-coded bit and what my/our code was producing, I worked out what was needed to get Jakob’s code to produce an image. And it came with the working caption!
Helped to have the right square brackets, and I ended up ditching a few chunks that would be required for a slideshow of multiple images. It could probably be even more stripped back, as I only ever wanted one image per article.
images: [ <txp:images id='<txp:custom_field name="article_image" limit="1" />'
break="," >
{ url: "<txp:image_url />", description: "<txp:image_info />" }
</txp:images> ],
Thanks so much for this. Always tangles my brain, and I can get back to producing the content!
Cheers from the wintery South Island of New Zealand
Graeme
Offline
#981 Today 09:10:23
Re: smd_gallery: super-flexible gallery generator
Glad you got it working. Just one thing to note: if you do have some article image fields with an as separator, they will likely fail as txp:images will try and process _123 456_ as a single image. Then you would need the conversion from at-sign to comma as separator:
id='<txp:custom_field name="article_image" breakby="@" break="," />'
As that will only split article image fields that contain an @-sign, article image fields with just one image or with images separated by commas will be unaffected, i.e. it shouldn’t hurt.
And if you add limit="1" as an attribute of txp:images (not custom_field), you can still ensure you only get one image output should there be more than one.
TXP Builders – finely-crafted code, design and txp
Offline