Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#925 2012-05-11 04:12:03

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

Re: smd_gallery: super-flexible gallery generator

Hi

Your slide show needs to be in a div with class="slideshow". Also you are not calling an image category (or you just have one image in that category). Can you post the code you are using?


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

Offline

#926 2012-11-12 15:12:07

miles
Member
From: Plymouth
Registered: 2008-05-22
Posts: 78
Website

Re: smd_gallery: super-flexible gallery generator

Possibly my favourite Textpattern plugin!

Hope someone can quickly help me. I want to simply have a page of “albums” then when the user clicks on an album all the thumbnails show for that album on the page.

How is this done in smd_gallery?

Offline

#927 2013-08-21 10:07:41

M_i
Member
Registered: 2006-03-05
Posts: 122

Re: smd_gallery: super-flexible gallery generator

All I want to do is count the number of article images attached to an article (and output that number in a way that I can do some PHP math with it) – is that possible with this plugin?

I’m currently using your excellent smd_slimbox for my galleries, displaying the article images for each article, so the notation of the image IDs for the article images uses the same format (usually a combination of ranges and comma separated lists).

Offline

#928 2013-08-21 19:43:51

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

Re: smd_gallery: super-flexible gallery generator

M_i wrote:

All I want to do is count the number of article images attached to an article (and output that number in a way that I can do some PHP math with it) – is that possible with this plugin?

Absolutely:

<txp:smd_gallery id="?article_image" limit="1">{maximages}</txp:smd_gallery>

The limit just stops the value of the maximum number of images from being displayed more than once. If you assigned this to a txp:variable you could do maths on it in PHP, or you could use the excellent adi_calc to help do some maths in a less geeky manner than reverting to PHP.

Also note, btw, that the value of {maximages} takes ranges into account and only counts images that exist. So if your list of article image IDs contained some images that had been deleted or there were bogus numbers in there, the plugin doesn’t care.

Hope that helps.

Last edited by Bloke (2013-08-21 19:46:29)


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

#929 2013-08-23 08:29:48

M_i
Member
Registered: 2006-03-05
Posts: 122

Re: smd_gallery: super-flexible gallery generator

Bloke wrote:

The limit just stops the value of the maximum number of images from being displayed more than once.

Ah! I was mucking about with {totalimages} instead of {maximages} and couldn’t figure out how to get the number just once. So simple!

Bloke wrote:

Hope that helps.

It does indeed! Thank you very much!

Offline

#930 2013-11-12 21:02:27

robew
New Member
Registered: 2013-11-12
Posts: 2

Re: smd_gallery: super-flexible gallery generator

I’ve searched this forum but didn’t find my issue – if I missed it please point me to it.

The problem I’ve run into has to do with the difference in behavior between “limit” and “thumblimit” attributes of the smd_gallery tag.

I’m trying to display a limited list of thumbnails with next and prev navigation. When viewing the full sized images (using smd_slimbox) referred to hereafter as “the lightbox”. I want the prev/next navigation to display images beyond what are shown in the thumbnail list, e.g. there are 8 images in the gallery, the thumbnail list shows 5 at a time, when viewing image 5 in the lightbox clicking “next” will display image 6 and so on until image 8.

To get the prev/next navigation with the thumbnails I have to use “limit”, that properly restricts the number of thumbnail images as well, it also restricts the lightbox to only navigate the images shown in the thumbnail list and not the entire gallery.

To be able to lightbox the entire gallery while limiting the number of thumbnails I can use “thumblimit”, but this won’t display prev/next links with the thumbnail list.

Any help is appreciated.

Offline

#931 2013-11-12 21:42:43

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

Re: smd_gallery: super-flexible gallery generator

robew wrote:

I’m trying to display a limited list of thumbnails with next and prev navigation.

Congratulations: I think you’ve found a limit to this plugin’s capabilities ;-)

I never considered the situation you might wish to independently paginate both thumbs and full size images. Can’t think of a neat way to handle it. It gets messy whichever way you try to bend the plugin with count forms or paging.

I’d be tempted to use no limits and employ a Javascript pagination plugin to hide the thumbnails in steps of 5 images. That way, you have control over how the thumbs behave / slide / fade. There may even be a Javascript gallery plugin you can use which will add the pagination from the full set of images / thumbs on the page. In which case, you probably won’t need smd_gallery at all and should try the built-in <txp:images> tag instead, which is versatile enough in the situation to drop suitable markup on the page.

Hope that helps.

Last edited by Bloke (2013-11-12 21:43:22)


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

#932 2013-11-13 04:14:29

robew
New Member
Registered: 2013-11-12
Posts: 2

Re: smd_gallery: super-flexible gallery generator

Bloke wrote:

Congratulations: I think you’ve found a limit to this plugin’s capabilities ;-)

Woot! do I win a prize?

Just knowing it is not capable is a big help, I can put my energy into a work-around.

Offline

#933 2014-03-17 00:42:21

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

Re: smd_gallery: super-flexible gallery generator

Bloke

A long, long time ago you assisted me in getting this concatenation together, and what a time that was, happy days.

<txp:smd_gallery id="?article_image"
      delim="@" paramdelim="|" collate="1"
     combo='sc_img| { url: "{url}", description: "{caption}" }'>
   images: [ {sc_img} ],
</txp:smd_gallery>

This is buried in the middle of the javascript and works admirably for individual articles.

<script type="text/javascript">
$("#front_showcase").showcase({
   css: { width: "1080px", height: "500px",},
   animation: { type: "fade", interval: 5000, speed: 1500 },
<txp:smd_gallery id="?article_image"
      delim="@" paramdelim="|" collate="1"
      combo='sc_img| { url: "{url}", description: "{caption}" }'>
  images: [ {sc_img} ],
</txp:smd_gallery>
  navigator: { css:  {    border: "none",
etc

Also, at the moment with each article_list, one in each section, I don’t use smd_gallery, it’s defined with a static setup like this. There’s 11 sections now and rather than using 10 conditionals I’ve created a separate page for each section.

images: [
      { url:"/images/40.jpg",description:”something”},
      { url:"/images/97.jpg", etc
     ],

and that also works OK.

Except. I’ve used adi_menu to break some sections into a number of sub-sections, sometimes 12 or so, and I’d like to have a different image or images with each sub-section. Kinda like this . . .

<txp:if_section name=“x-a”>
   show image a1, a2  
</txp:if_section>
<else />
<txp:if_section name=“x-b”>
 show image b  
</txp:if_section>
<else />
<txp:if_section name=“x-c”>
 show image c1, c2, c3, c4  
</txp:if_section>
<else />
<txp:if_section name=“x-d”>
etc

Whadda ya reckon might be the best way to structure this to incorporate it within the whole mess of the js and bearing in mind these subsections seem to be breeding.

I’ve tried a whole host of things about where to whack in the conditionals but I’m unable to get an image loading.

I guess you can tell there some sort of overall logic missing here. Any suggestions?

cheers,

Graeme

Offline

#934 2014-03-17 05:39:53

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

Re: smd_gallery: super-flexible gallery generator

Hi Graeme,

If you create image categories and subcategories with the same names as your sections you could have something like the untested code below:

<txp:varible name="hassubcategories" value='<txp:category_list type="image" parent=''<txp:section />'' >' />
<txp:if_variable name="hassubcategories" value="">
<txp:images category='<txp:section />' >
<a href="<txp:image />"><txp:thumbnail class="your class" /></a>
</txp:images>
<txp:else />
<txp:images category='<txp:category_list type="image" parent=''<txp:section />'' >
<txp:category type="image" /></txp:category_list>' >
<a href="<txp:image />"><txp:thumbnail class="your class" /></a>
</txp:images>
</txp:if_variable>

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

Offline

#935 2014-03-17 20:01:22

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

Re: smd_gallery: super-flexible gallery generator

Y

Thanks for that.

Yes, that’s given me a new and better track to explore.

I’ll need to adapt it to the js script, showcase.js is an old, ie, 2010, now discontinued, slideshow that hides the caption until you mouse over it, so it has to include the caption, hence the combo. It was the most adaptable slideshow around at the time. Maybe I should look for a newer script that incorporates the captions automatically, that would simplify the whole mess.

Just as long as I don’t get lost in all those single quote marks . . .

Offline

#936 2014-04-30 04:29:21

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

Re: smd_gallery: super-flexible gallery generator

Yiannis

Finally, 6 weeks later, I had time to work through this, the clue was your suggestion to create a gallery with the same category name as the sub-section it was in. I could then switch

id="?article_image"

which was throwing a slideshow, ie, multiple article images, on the individual article pages to

category='<txp:section />' 

for a slideshow on each article list page, all consistently formatted.

I guess this explanation sounds somewhat confusing but maybe this needs to be documented in the Help file because it’s so useful to get images on article list pages where there aren’t any article images.

smd_gallery is unbelieveable, thanks Bloke.

Oh, now I’ve gotta organise 12 odd galleries with 3 images each, shouldn’t take more than 8 hours work . . .

Graeme

Last edited by detail (2014-04-30 04:33:00)

Offline

Board footer

Powered by FluxBB