Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#961 2021-07-18 09:58:22

Gallex
Member
Registered: 2006-10-08
Posts: 1,308

Re: smd_gallery: super-flexible gallery generator

hi!

after upgrade to 4.8.7 i get error:

<b>Deprecated</b>:  Methods with the same name as their class will not be constructors in a future version of PHP; smd_MLP has a deprecated constructor in <b>/data02/virt34253/domeenid/www.arrakis.ee/htdocs/textpattern/plugins/smd_lib/smd_lib.php</b> on line <b>5</b><br />

PHP 7.4.2

Offline

#962 2021-07-18 10:39:48

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

Re: smd_gallery: super-flexible gallery generator

Try the latest version of smd_lib.


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

#963 2021-07-18 11:03:31

Gallex
Member
Registered: 2006-10-08
Posts: 1,308

Re: smd_gallery: super-flexible gallery generator

Bloke wrote #331054:

Try the latest version of smd_lib.

that helped, thank you!

Offline

#964 2023-12-24 05:25:10

detail
Member
From: geez, I seem to be in NZ
Registered: 2010-07-13
Posts: 177
Website

Re: smd_gallery: super-flexible gallery generator

Happy holidays, peeps!

After some procrastination, I finally updated the last of my websites to TXP 4.8.8.

This has caused some article_image links to break.

Individual articles do render single article_images. An article_custom list sometimes does not.

The most likely reason is that I have multiple article images on occasional articles for a slideshow, separated by @.

 6027 @ 6028 @ 6029 @ 6030 @ 6031 

When I look at a particular article, it still renders as a js slideshow, thanks to some clever delim=“@“ type suggestions by Bloke as part of the smd_gallery plugin. That is working in 4.8.8 as it has forever, with the slideshow doing its thing.

<txp:smd_gallery category="landing" 
    delim="@" paramdelim="|" collate="1" limit="4" sort="random"
     combo='sc_img| { url: "{url}", description: "{caption}" }'>
        images: [ {sc_img} ],
</txp:smd_gallery>

That’s great that this still works a decade later, going from 4.2 to 4.8.8.

However . . .

There’s another circumstance with an article_custom list. This has the title and excerpt but now has a broken image link.

<txp:article_custom limit="1" section="gear" sort="rand()" form="gear_list" />

The article image part of the gear_list form that is not rendering:

<div class="align-center"><txp:permlink><txp:article_image width="450px" height="208px" thumbnail="1" /></txp:permlink></div>

This used to produce a single image, the lowest ID number, no matter how many article images there were for an article. Now I get a broken link.

It looks like 4.8.8 chokes on the multiple article images.

I’m wondering how I can add limit=“1” to the article image to just get it to render the first image and ignore the @.

When I think about it, there are 100s of instances of articles with multiple article_images.

Any help gratefully accepted.

Last edited by detail (2023-12-24 05:28:23)

Offline

#965 2023-12-24 08:33:54

etc
Developer
Registered: 2010-11-11
Posts: 5,194
Website GitHub

Re: smd_gallery: super-flexible gallery generator

Did it again, sorry :-) The idea was to allow for URLs (like https://example.com/my_image.png) in article image, but this has broken hacks. Will see how to patch it in 4.9.

Meanwhile, you can try the following:

<txp:image id='<txp:custom_field name="article_image" breakby="@" limit="1" />'
    width="450px" height="208px" thumbnail="1" />

If needed, you can add sort="rand" to <txp:custom_field /> attributes. Hope that helps.

Offline

#966 2023-12-27 08:22:20

detail
Member
From: geez, I seem to be in NZ
Registered: 2010-07-13
Posts: 177
Website

Re: smd_gallery: super-flexible gallery generator

etc wrote #336219:
<txp:image id='<txp:custom_field name="article_image" breakby="@" limit="1" />' 
width="450px" height="208px" thumbnail="1" />

Hey thanks for the prompt response with this obscure question on a remote corner of txp.

I’ve been visiting family and travelling, so will test this tomorrow.

Let you know how it goes, but that looks plausible!

Cheers

GJ in New Zealand

Offline

#967 2023-12-28 05:28:59

detail
Member
From: geez, I seem to be in NZ
Registered: 2010-07-13
Posts: 177
Website

Re: smd_gallery: super-flexible gallery generator

etc wrote #336219:

Hope that helps.

Sure does.

A Christmas treat.

Thanks, etc.

Amazing that my 1500+ page/6000+ image website is still chugging along 13 years later with only minor tweaks required.

Says something about the logical architecture of TXP. And the considerable efforts of The Team to maintain things.

Last edited by detail (2023-12-28 05:29:24)

Offline

#968 2024-05-26 23:41:42

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 595
Website

Re: smd_gallery: super-flexible gallery generator

Hi Stef & All,

I recently made some changes to my integration of smd_gallery, and had a question:

Is there a way to link (from another page) from an image’s thumbnail, to the same image on its smd_gallery pagination page? Maybe even scrolling down to it via anchor.

Example: Please see the right-sidebar “Selections” image links here: Friendlyskies.net

Right now these will link simply to the /imagery section. But I want to do better than this if possible, and link to the image that’s been clicked on.

Possible? Thanks as always for this really helpful plugin.

Last edited by maruchan (2024-05-27 00:22:35)

Offline

#969 2024-09-30 20:24:37

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 595
Website

Re: smd_gallery: super-flexible gallery generator

maruchan wrote #337235:

I recently made some changes to my integration of smd_gallery, and had a question:

Is there a way to link (from another page) from an image’s thumbnail, to the same image on its smd_gallery pagination page? Maybe even scrolling down to it via anchor.

Right now these will link simply to the /imagery section. But I want to do better than this if possible, and link to the image that’s been clicked on.
p.

Answering my own Q, but here it is in case helpful to anyone!

<txp:images category="sidebar-highlights" limit="12" sort="date desc" break="">
    <a class="item" href='https://www.example.com/imagery#img<txp:image_info type="id" />'>
        <img class="" src='<txp:site_url/>mthumb.php?src=<txp:image_url />&amp;h=1280&amp;w=1280' alt='<txp:image_info /> highlight photo' />
    </a>
</txp:images>

Now I’m just wondering how to link deeper, into the pagination, from my sidebar images at the same site

Last edited by maruchan (2024-09-30 20:32:51)

Offline

#970 2024-09-30 20:26:30

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

Re: smd_gallery: super-flexible gallery generator

Urk, sorry I didn’t answer. I meant to and got sidetracked. Apologies, but glad you found a solution in the meantime.


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

#971 2024-09-30 20:33:45

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 595
Website

Re: smd_gallery: super-flexible gallery generator

Bloke wrote #337904:

Urk, sorry I didn’t answer. I meant to and got sidetracked. Apologies, but glad you found a solution in the meantime.

Thanks and no worries! I know you are super busy. Now I’m just wondering how to link into the pagination, from the random images in the right-sidebar at the same site

Offline

#972 2024-09-30 21:19:07

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

Re: smd_gallery: super-flexible gallery generator

maruchan wrote #337905:

Thanks and no worries! I know you are super busy. Now I’m just wondering how to link into the pagination, from the random images in the right-sidebar

Now that is a challenge! How would you know what page the clicked image is on, short of assuming that the images are sequential and dividing the total by the number of images per page to predict the page number and injecting it in the URL as &@pg=@?


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