Textpattern CMS support forum

You are not logged in. Register | Login | Help

#321 2009-01-06 06:43:58

quemultimedia
Member
From: Nairobi
Registered: 2008-12-31
Posts: 42
Website

Re: smd_gallery: super-flexible gallery generator

Thanks Bloke,

Indeed, I’m loving the response I’m getting from the TXP community, so far, I’ve made progress by leaps and bounds, and, with your advise above, hoping to implement a super slide-show using both smd_gallery and smoothgallery.

Will post some feedback on what I come across, as I make progress.


Que,
Que-Multimedia

Offline

#322 2009-01-06 09:54:49

quemultimedia
Member
From: Nairobi
Registered: 2008-12-31
Posts: 42
Website

Re: smd_gallery: super-flexible gallery generator

Bloke, Guys,

The gallery’s now working…. however, I have some small question. How can I display images from different galleries [i.e. a root gallery, and it’s sub-galleries], with minimal code? or do I just have to call all galleries individually?


Que,
Que-Multimedia

Offline

#323 2009-01-06 10:08:29

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,672
Website

Re: smd_gallery: super-flexible gallery generator

quemultimedia wrote:

How can I display images from different galleries [i.e. a root gallery, and it’s sub-galleries]

Depends what you want to achieve.

<txp:smd-gallery category="root_gallery" sublevel="all" />

Displays all images from all sub-categories of root_gallery, sorted by category. With the onchange attribute suite you can put headings above each change in category if you wish.

If you are trying to do something different, please provide an example.

Last edited by Bloke (2009-01-06 10:10:06)


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

#324 2009-01-06 22:01:24

rvturnage
New Member
Registered: 2009-01-06
Posts: 5

Re: smd_gallery: super-flexible gallery generator

Bloke, this is a very nice plugin. I’m a newbie to Textpattern and have been testing the waters since yesterday, in the hopes of figuring it out for a new prospective client. It seems to be far easier to dive into than ExpressionEngine! And it also seems to have a great online community, based on this thread! I have been able to install smb_gallery and get it working with jquery Gallerific plugin.

I’ve got a couple of questions, though, about creating a “gallery homepage”, featuring a single thumbnail from each image category with a link to view the full gallery.

First, I’ve got a parent image category named “Gallery”, with child categories for each individual gallery I’ll want to show (2008_gallery, 2009_gallery, etc.). I’m using this in my page code:

<txp:smd_gallery category="gallery" onchange="category" onchangewraptag="h2" sublevel="1" sort="fixed" thumb="1" thumblimit="1" form="gallery_overview" />

and this in my form: {onchange:category} {grouptagstart} <a href="#"><img src="{url}" alt="{alt}" /></a> <div>{title}</div> {grouptagend}

For some reason, the “thumblimit” isn’t limiting the number of thumbs that appear. It’s showing every thumbnail in each of the two categories (2008_gallery & 2009_gallery). Any ideas?

Second, is there some way to have the category attribute pulled from the URL so galleries could be loaded dynamically based on the URL?

Something like mysite.com/textpattern/gallery_view/2008_gallery/ would then load the category named “2008_gallery” into the category attribute used on the gallery_view page. This would enable me to code one gallery_view page and eliminate the need to create new gallery pages when a client wants to add a new gallery. Simply uploading the image to a new image category and then entering the gallery_view URL followed by the category name would suffice. I tried using the category=”?” attribute, but couldn’t figure out how to make it work properly…

Thanks in advance! and thanks for the great plugin!
rvt

Offline

#325 2009-01-07 10:13:21

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,672
Website

Re: smd_gallery: super-flexible gallery generator

rvturnage wrote:

{onchange:category} {grouptagstart} <a href="#"><img src="{url}" alt="{alt}" /></a> <div>{title}</div> {grouptagend}

Hi, this is one of the unfortunate side-effects of not having image encapsulation in TXP. I answered something similar a few weeks ago and that may help you work out a solution in the meantime, though it requires another plugin.

The bottom line is that every image is passed through the form and only the {object} tag understands thumblimit. I’d love to make the form/thumblimit and {object} a bit more intelligent but it either takes a tonne of extra code or a change to the way images are handled in TXP.

Having said that, I may try and revamp it a bit, because having to rely on the {object} tag as a fixed output is a pain. Perhaps an objectform might be possible, I’ll look into it and see what I can come up with.

Second, is there some way to have the category attribute pulled from the URL so galleries could be loaded dynamically based on the URL?

Today the answer is no, sorry. Tomorrow (or in a few days time at least) the answer will be yes because v0.5 unlocks this feature since it uses smd_lib which has this ability built in. So under v0.5 you’ll be able to do:

<txp:smd_gallery category="?title" />

In your case you’d need to do something a little differently because you intend not to actually create any corresponding article. In that case you have two avenues open to you:

  1. fashion your URLs like this: site.com/gallery_view/?gall=2008-gallery and use <txp:smd_gallery category="?gall" /> to read in the URL variable (perhaps gbp_permanent_links can help hide the messy URLs?)
  2. use an error_404 page template that does this somewhere inside it:
<txp:if_section name="gallery_view">
  <txp:smd_gallery category="?REQUEST_URI" form="gallery_overview" />
</txp:if_section>

(untested – might not work like that)

The idea of the last approach is that any broken link in that section will actually render a gallery. You might also want to surround the gallery tag with some conditional (e.g. the chh_if_data plugin or some clever use of the URL parts to extract the ‘title’ and put it in a <txp:variable /> that you can check), thus you can take action and show “Sorry, no gallery” for the times where there’s actually no image category of that name.

Not quite the answers you hoped, but possible avenues for exploration. I’ll try and package up v0.5 as soon as I can and release it.


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

#326 2009-01-07 11:06:15

lozmatic
Member
From: Melbourne, Australia
Registered: 2006-08-27
Posts: 259
Website

Re: smd_gallery: super-flexible gallery generator

Hi, thumblimit="1" isn’t working for me. All images are displayed instead.

I’ve got this:

<txp:smd_gallery id='17,18' thumb="0:1" form="list.photo.apartment.form" thumblimit="1" />

and the form is the one in the example:

<a rel="lightbox-smd" href="{url}" title="{title}">{object}</a>

Any ideas?

Offline

#327 2009-01-07 11:21:12

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,672
Website

Re: smd_gallery: super-flexible gallery generator

lozmatic wrote:

thumblimit="1" isn’t working for me. All images are displayed instead.

Add onchange="" to your gallery tag; by default it’s set to category. Since you’re using id instead of category, the plugin sees the 2nd image is in a new category and dutifully thinks it needs to start counting thumbs again from 1 (it resets the counter at each onchange item so you can make headed sub-galleries with one smd_gallery tag — in this case you don’t want it to do that).


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

#328 2009-01-07 14:27:16

rvturnage
New Member
Registered: 2009-01-06
Posts: 5

Re: smd_gallery: super-flexible gallery generator

Bloke wrote:

Hi, this is one of the unfortunate side-effects of not having image encapsulation in TXP. I answered something similar a few weeks ago and that may help you work out a solution in the meantime, though it requires another plugin.

Thanks, Bloke. Sorry I missed that post. I tried reading through all 33 pages prior to posting. Guess I missed a few :) I’ll go over that previous post and see if I can get it working.

Today the answer is no, sorry. Tomorrow (or in a few days time at least) the answer will be yes because v0.5 unlocks this feature since it uses smd_lib which has this ability built in. So under v0.5 you’ll be able to do:

<txp:smd_gallery category="?title" />

Not quite the answers you hoped, but possible avenues for exploration. I’ll try and package up v0.5 as soon as I can and release it.

These both look like good avenues to explore..thanks for the help. I’ll look into that gbp_permanent_links plugin too. I look forward to trying out that upgrade when you get it! Thanks again for your help, and for the great plugin.

rvt

Offline

#329 2009-01-07 14:44:55

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,672
Website

Re: smd_gallery: super-flexible gallery generator

rvturnage wrote:

Sorry I missed that post. I tried reading through all 33 pages prior to posting.

No problem. Do what I do and set your forum profile to view 20 posts per page, then it only looks half as bad :-D

Hope you find a (hopefully temporary) solution until I can address these things in the plugin itself.


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

#330 2009-01-09 14:02:03

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

Re: smd_gallery: super-flexible gallery generator

Hellooooo,

I’ve this:

<txp:smd_gallery id="?article_image" combo="type:captioned-image,align:right" form="inline_image" />

calling this:

<txp:variable name="type" value="{type}" />
<div class="image {type} {align}" style="width:{width}px">
  <txp:upm_image image_id="{id}">
  <img src="{url}" width="{width}" height="{height}" alt="<txp:upm_img_alt />" title="<txp:upm_img_caption />"/>
  <txp:if_variable name="type" value="captioned-image">
  <small><txp:upm_img_caption /></small>
  </txp:if_variable>
  </txp:upm_image>
</div>

It works like a charm… but I was thinking how to let the end-user have more control about alignment and show/hide caption… without using custom fields…

So, I came up with this idea (ejem… feature request): abuse the article_image field :D.
Something like this (on the article_image input field):

68, captioned, right
or
15, image, left
or even crazier:
19, captioned, left, 15, captioned, right, 28, image, center

And so on…
Of course, this will require some clever way to “configure” how (in which order) smd_gallery will pick up the values…

Bloke, the ball is in your field ;)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB