Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#493 2009-06-13 08:14:13

alanpmcd
Member
Registered: 2009-05-02
Posts: 21

Re: smd_gallery: super-flexible gallery generator

Thanks, yes, you have helped me define where I want to go. I hope you don’t mind my continuing to ask questions.

What I’m looking for is to enable a user to choose among image categories then see a sub-gallery from just that category with a click. (Obviously if I crack it I’ll give them more choices but let’s build Rome first) I still cannot see quite how to do that. I found that ‘a bunch of galleries from [my] actual list of image categories’ as you put it didn’t quite work out as you’d proposed, but I’ve made it work instead with this code:

<txp:category_list type=“image”>
<txp:smd_gallery category=’<txp:category />’ limit=“5” form=“panel_captionedpics” onchange=“category_title” onchangewraptag=“h3” />
</txp:category_list>

…then putting {onchange:category_title} in my output form.

Now the code you proposed <txp:category_list title=“1” /> does create a list of links to html pages named after each image category in turn. But how can I turn that into the output of my panel_captionedpics form, with just the name of the image-category changed according to the user choice? That’s what I would like to do. I think you mention that option in your penultimate para ‘…read the category name from some other source…a variable in the URL.’ Can I do that via text pattern and smd_gallery? I’ll keep trying, but any help would be gratefully received.

alanpmcd

Offline

#494 2009-06-14 20:24:06

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

Re: smd_gallery: super-flexible gallery generator

alanpmcd

Sorry for the slightly bogus code in my example. You are correct that you’d need the onchange to distinguish between the categories inside the category_list container. Glad you got that bit sorted despite my meddling!

enable a user to choose among image categories then see a sub-gallery from just that category with a click.

You are correct that the essence hinges on passing the category name forward to a page that can read it, then display the given gallery. I would suggest this (untested) approach:

<txp:category_list type="image">
  <a href="/gallery?cat=<txp:category />"><txp:category title="1" /></a>
</txp:category_list>

So that simply lists each (image) category in your database and turns each into a hyperlink to a section called gallery, passing the name of the category as the cat URL variable. You could of course use smd_gallery in the container to give a ‘sneak peek’ of some of the images in each category if you wish, as you did before.

Then, in the Page for the gallery Section, somewhere in the page flow (after all the usual HTML gubbins) you can put:

<txp:smd_gallery category="?cat">
   // Show the pics/thumbs here
</txp:smd_gallery>

That simply reads the URL variable ?cat and plugs it into the category. Job done.

Hope that helps, but do shout back if not (or indeed if you find a better way / my code sucks!)


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

#495 2009-06-16 21:02:06

alanpmcd
Member
Registered: 2009-05-02
Posts: 21

Re: smd_gallery: super-flexible gallery generator

Thanks I’ll give that a whirl. I’ve so far gone down the workable but very convoluted path of creating a blank article for each image-category, then converting that into a custom field. It works! But if your code works it’ll be simpler :)

alanpmcd

Offline

#496 2009-06-25 12:34:31

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,011
Website GitHub Mastodon Twitter

Re: smd_gallery: super-flexible gallery generator

Hi Stef, all…

I’m not certain as to what I am doing wrong here but I am trying to do something which on the surface seems simple enough but I’m yet to figure it out.

I am using

<txp:smd_gallery objectform="front-page-images" category="front-images" />

with front-page-images form containing

<a href="#"><img src="<txp:site_url />images/{imagedef}" title="{caption}" alt="{alt}" /></a>

What i expect to get is a series if “linked” images from the category front-images with the code looking like

<a href="#"><img src="http://site.tld/images/2.jpg" title="some title" alt="alt here" /></a>
<a href="#"><img src="http://site.tld/images/3.jpg" title="some other title" alt="some other alt here" /></a>

Note that I do not want the width/height.

What I am getting instead is a series of images from the desired category but with additional not wanted info

<a href="http://localhost:8888/images/2.jpg" alt="e-Mobil Art"><img src="http://localhost:8888/images/2.jpg" width="1280" height="960" alt="e-Mobil Art" title="e-Mobil Art" /></a>
<a href="http://localhost:8888/images/3.jpg" alt="IN TRANSITION: Cultural Identities in the Age of Transnational and Transcultural Flux"><img src="http://localhost:8888/images/3.jpg" width="1280" height="960" alt="IN TRANSITION: Cultural Identities in the Age of Transnational and Transcultural Flux" title="IN TRANSITION: Cultural Identities in the Age of Transnational and Transcultural Flux" /></a>
<a href="http://localhost:8888/images/4.jpg" alt="IN TRANSITION: Cultural Identities in the Age of Transnational and Transcultural Flux"><img src="http://localhost:8888/images/4.jpg" width="1280" height="960" alt="IN TRANSITION: Cultural Identities in the Age of Transnational and Transcultural Flux" title="IN TRANSITION: Cultural Identities in the Age of Transnational and Transcultural Flux" /></a>
<a href="http://localhost:8888/images/5.jpg" alt="Ideodrome"><img src="http://localhost:8888/images/5.jpg" width="1280" height="960" alt="Ideodrome" title="Ideodrome" /></a>
<a href="http://localhost:8888/images/6.jpg" alt="In Transition Russia 2008"><img src="http://localhost:8888/images/6.jpg" width="1280" height="960" alt="In Transition Russia 2008" title="In Transition Russia 2008" /></a>
<a href="http://localhost:8888/images/7.jpg" alt="In Transition Russia 2008"><img src="http://localhost:8888/images/7.jpg" width="1280" height="960" alt="In Transition Russia 2008" title="In Transition Russia 2008" /></a>
<a href="http://localhost:8888/images/8.jpg" alt="The Mirror Stage - Audio Visual Perfomance"><img src="http://localhost:8888/images/8.jpg" width="1280" height="960" alt="The Mirror Stage - Audio Visual Perfomance" title="The Mirror Stage - Audio Visual Perfomance" /></a>
<a href="http://localhost:8888/images/9.jpg" alt="The Mirror Stage"><img src="http://localhost:8888/images/9.jpg" width="1280" height="960" alt="The Mirror Stage" title="The Mirror Stage" /></a>
<a href="http://localhost:8888/images/10.jpg" alt="The Mirror Stage - Talks"><img src="http://localhost:8888/images/10.jpg" width="1280" height="960" alt="The Mirror Stage - Talks" title="The Mirror Stage - Talks" /></a>
<a href="http://localhost:8888/images/11.jpg" alt="Visual Language and Media"><img src="http://localhost:8888/images/11.jpg" width="1280" height="960" alt="Visual Language and Media" title="Visual Language and Media" /></a>

Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#497 2009-06-25 12:54:54

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

Re: smd_gallery: super-flexible gallery generator

colak wrote:

What I am getting instead is a series of images from the desired category but with additional not wanted info

Use form (or container) instead of objectform — objectform has a very specific use case for processing the {object} replacement tag, which you are not using in this case.


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

#498 2009-06-25 13:16:32

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,011
Website GitHub Mastodon Twitter

Re: smd_gallery: super-flexible gallery generator

yep that did it! My hair is safe now!


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#499 2009-06-25 18:50:43

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

Re: smd_gallery: super-flexible gallery generator

maniqui wrote:

mrtunes, have you tried the compressed version?

yes this works. can someone explain to me why only compressed versions work on my site? are people installing the fuller version by some other means?

Offline

#500 2009-06-26 02:31:34

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

Re: smd_gallery: super-flexible gallery generator

mrtunes wrote:

can someone explain to me why only compressed versions work on my site? are people installing the fuller version by some other means?

Compressed is just the format in which the plugin is delivered for installation — it’s the same code either way. See here for more explanation.


Code is topiary

Offline

#501 2009-06-26 14:47:12

nejra
Member
From: Groningen
Registered: 2006-07-06
Posts: 38
Website

Re: smd_gallery: super-flexible gallery generator

Wow, this is exactly what I’m looking for. Not much info from my part, but a great plug-in. Very easy, yet very, very flexible! Cheers!

Last edited by nejra (2009-06-26 14:47:41)

Offline

#502 2009-07-02 13:31:47

mfos
Member
Registered: 2008-12-11
Posts: 34

Re: smd_gallery: super-flexible gallery generator

Hi,
Been looking at the posts here and can’t a solution to my problem but I bet I didn’t look hard enough.

I have a number of articles and I need to have multiple images associated with them.
I have 4 category pages showing each of the related articles.
When I click on an article I would like to show the article and its associated images using a thumbnail for images not being displayed in the main image window.

I hope I’m making sense.

How do I get smd_gallery to pull out images associated with an article rather than just images associated with a category.

Pulling my hair out on this one.

Thanks
mic

Offline

#503 2009-07-02 14:52:48

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

Re: smd_gallery: super-flexible gallery generator

mfos wrote:

How do I get smd_gallery to pull out images associated with an article rather than just images associated with a category.

You could put the image IDs into the article image field (comma separated) or list them in a custom field, then use <txp:smd_gallery id="?article_image" /> to get the IDs of the images in the article. Use a Form or the smd_gallery container to format the thumbs/image links how you wish.

Last edited by Bloke (2009-07-02 14:53:25)


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

#504 2009-07-08 10:00:19

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: smd_gallery: super-flexible gallery generator

Bloke – just came here cos I had a problem… read the thread and now its fixed… you are still a genius, great plugin

Thanks mate :)

Offline

Board footer

Powered by FluxBB