Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#481 2009-05-12 17:42:57

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,446
Website GitHub

Re: smd_gallery: super-flexible gallery generator

kvnmcwebn wrote:

Basically how do I get this duration into the below form?

I’m not 100% sure but I think you just list any parameters like that inside the new Slideshow, e.g:

var myShow = new Slideshow('slideshow', 
  [{imglist}], 
  {
    hu: "<txp:site_url />images/",
    type: "fade",
    duration: 2000 
  }
);

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

#482 2009-05-12 18:10:50

kvnmcwebn
Member
From: Ireland
Registered: 2007-01-27
Posts: 724
Website

Re: smd_gallery: super-flexible gallery generator

Bloke wrote:

Cheers bloke easier than I thought, just added quotations and it works grand.
I didn’t expect it but it slows the transitions down as well.


<script type="text/javascript">
var myShow = new Slideshow('slideshow', 
  [{imglist}], 
  {
    hu: "<txp:site_url />images/",
    type: "fade",
duration: "2000",
  }
);
</script>

edited to say no doesn’t need quotes.

Last edited by kvnmcwebn (2009-05-12 18:15:39)


its a bad hen that wont scratch itself.
photogallery

Offline

#483 2009-05-14 17:07:16

Gulfcoast
Member
Registered: 2009-04-12
Posts: 76

Re: smd_gallery: super-flexible gallery generator

Just getting my feet wet with the plugin and gone through the steps on slideshow and pagination. With regards to slideshow I get the first image to show but no link when clicking on the first image. With regards to pagination I also get the first image and I see # of pics: 5
First « 1 » Last but once again no thumbs just broken image thumbs and no ability to link through to the next image. Any idea on where my problem might lie? Thank you.

Offline

#484 2009-05-15 02:16:25

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,446
Website GitHub

Re: smd_gallery: super-flexible gallery generator

Gulfcoast wrote:

Any idea on where my problem might lie?

Not without seeing some code and/or a site link that shows the failing galleries ,sorry.


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

#485 2009-05-26 16:50:07

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

Re: smd_gallery: super-flexible gallery generator

hey stef, on page 39 of support here i had a problem where i would put the latest plugin code into the box and it says “badly formed…” and rejects it. i’m still having this problem on fresh 4.0.8 installs. i do install the lib 0.36 and enable it beforehand. just wanted to check with you about it cause i’m not sure why it’s happening? thanks

Offline

#486 2009-05-26 16:58:32

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: smd_gallery: super-flexible gallery generator

mrtunes, have you tried the compressed version?


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#487 2009-06-12 10:59:58

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

Re: smd_gallery: super-flexible gallery generator

I’m trying to set up a gallery with sub-galleries per image category. It looks great with all images displayed, using the forms in the tag below. But I can’t make the category thing work. Here’s my test tag within a pictures section:

<txp:_gallery category=”?c” form=“panel_captionedpics” limit=“35” pageform=“pictures_nav” navclass=“picnavlist”/>

Here is an error message I’m receiving:

Tag error: <txp:_gallery category=”?c” form=“panel_captionedpics” limit=“35” pageform=“pictures_nav” navclass=“picnavlist”/> -> Textpattern Warning: tag does not exist on line 1104

Pardon my ignorance, I’m new to textpattern and the plugin. Do I need some kind of ‘if data’ loop in the form? or am I missing something else? Any help gratefully received.

alanpmcd

Offline

#488 2009-06-12 11:25:54

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,446
Website GitHub

Re: smd_gallery: super-flexible gallery generator

alanpmcd wrote:

Tag error: <txp:_gallery… <snip>

You should amend the tag name. It’s <txp:smd_gallery... :-) After that, give us a shout back if you can’t get the gallery going.


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

#489 2009-06-12 11:52:31

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

Re: smd_gallery: super-flexible gallery generator

Oh I’m sorry, what an idiotic error, how patient and kind of you to reply. I’ll give it a try and see what happens next.

alanpmcd

Offline

#490 2009-06-12 12:02:25

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,446
Website GitHub

Re: smd_gallery: super-flexible gallery generator

alanpmcd wrote:

what an idiotic error

lol, don’t worry about it: we’ve all been there. I’ve used some tags before, stared at them for ages, tweaked the attributes and couldn’t figure out why it wasn’t working how I expected. I posted on the forum and within minutes someone pointed out I’d missed an equals sign between an attribute name and its value. D’oh!


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

#491 2009-06-12 17:25:49

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

Re: smd_gallery: super-flexible gallery generator

Having got past the idotic error, I’m back. I love the basic gallery and am playing with FancyZoom to show individual pics and all that’s fine.

But. Here’s my tag:

<txp:smd_gallery category=”?c” form=“panel_captionedpics” limit=“35” pageform=“pictures_nav” navclass=“picnavlist” />

I was basing this on a query from someone weeks ago, that that format should produce category-based galleries. For me it produces an utter blank. Inserting an actual category produces a gallery so it’s something about the “?c” Do you know what it is?

Thanks, I hope I’m not being daft again.

alanpmcd

Offline

#492 2009-06-12 21:13:06

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,446
Website GitHub

Re: smd_gallery: super-flexible gallery generator

alanpmcd wrote:

produce category-based galleries.

Hehe, it should, but it depends how you define category-based! Let me explain.

When you view a list of articles in a particular category (e.g. site.com/category/animals) that category name becomes what I call the “current” category. The ?c in smd_gallery simply reads this category name (if it exists) and looks for images with that same category name. So in the above example, your tag:

<txp:smd_gallery category="?c">

is interpreted as:

<txp:smd_gallery category="animals">

But if you are not viewing a category, i.e. your URL is site.com/article/lions then your smd_gallery tag sees:

<txp:smd_gallery category="">

which is why you see nothing. So in order to actually get your example to show any gallery at all you need to do two things:

  1. make sure you have defined some image categories that match article categories
  2. ensure the smd_gallery tag is inside a <txp:if_category> conditional

Alternatively, you might want to display images that match the category1 or category2 of the current article. Again, make sure you have some common categories and then put your smd_gallery tag inside a <txp:if_individual_article> conditional and change it to:

<txp:smd_gallery category="?category1">

(or ?category2 of course, or even both separated by a comma to list all images that match either category)

Another alternative is to read the category name(s) from some other source; it could be a custom field in an article, or a variable in the URL. Or you might perhaps want to show people a bunch of galleries from your actual list of image categories:

<txp:category_list type="image">
   <h2><txp:category title="1" /></h2>
   <txp:smd_gallery category='<txp:category />' limit="5" />
</txp:category_list>

That would show 5 images from every image category you have defined, and display the images under their respective category headings.

So you can see why I said it depends how you define ‘category-based’ :-) Does any of that get you going in the kind of direction you want to go?

Last edited by Bloke (2009-06-12 21:17:12)


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

#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: 12,446
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.

Hire 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

Board footer

Powered by FluxBB