Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#313 2008-12-24 19:39:56

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

Re: smd_gallery: super-flexible gallery generator

maniqui wrote:

I have yet to test this, but I’m confident your crazy plug-in is capable of doing this :D

Worked like a charm.
That combo thing should be a txp standard :D

Edit: I add:

The combo thing is like the attributes-on-the-fly I asked above. It lets you create some kind of dictionary (or keywords arguments) and it opens a whole new world of possibilities.
Mix it with txp:variable and txp:if_variable and the possibilities become a whole new endless universe.

In other words, txp:tags + forms would become almost real functions (I know, they are functions) that let you create your own dictionary of keyword arguments on the fly.

Last edited by maniqui (2008-12-24 19:54:16)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#314 2008-12-26 03:23:12

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

Re: smd_gallery: super-flexible gallery generator

Tip: if you are having a hard time on sorting/offsetting/limiting your set of article images in some preferred order, using one (or many) smd_gallery tags and the id="?article_image" attribute/value, don’t forget to use the sort="fixed" attribute/value. Then, the smd_gallery tags will act correctly.

Last edited by maniqui (2008-12-26 03:23:29)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#315 2008-12-26 21:08:15

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

Re: smd_gallery: super-flexible gallery generator

curiouz

Maniqui (thanks) is right : MLP is on its way to this plugin at last. Steve has kindly revamped the way MLP does its query handling to work seamlessly with smd_gallery and it’s rockin’ on all cylinders. I have one outstanding issue to resolve that may (or may not) be because my test environment is in a subdirectory. If I get back affirmation from Steve that it’s simply the subdir causing the pagination problems then I’ll go ahead and release the version I have. It also addresses pretty much everything maniqui raised, i.e. has html_id and escape attributes, date formatting, and so on.

maniqui

Glad you’re finding combos useful :-) They were a result of one of my random “I wonder if…” thought processes, sparked while I was doing some mundane chore like vacuuming the house one day. What’s more exciting in v0.5 of smd_gallery is that — because of MLP support — the plugin will (kind of unfortunately) require smd_lib. But the upside is that txp:variable support becomes native to things like combos. So you won’t even have to use quotes and stuff to insert a <txp:variable name="read_my_var" /> tag as you can just use combo="megaclass:maniqui_?title_?read_my_var" to base the class name on whatever info you care to throw at it. And if you redefine the variable for each image in your gallery, the combo changes likewise.

In addition, if something like my image patch ever gets ratified for core use, you essentially get the essence of upm_image built into the core but in a reduced tag set. smd_lib is already poised to take advantage of this, giving even more flexibility in how you set up galleries.

Tip: if you are having a hard time on sorting/offsetting/limiting your set of article images in some preferred order… don’t forget to use the sort=“fixed” attribute/value

Thanks for clarifying that. It can become confusing because of the way fixed (and random to some degree) work. Certainly random depends on where it is placed in the sort attribute as it behaves differently in different positions. I have tried to explain it in the plugin help but it’s a tough one without some actual examples to back it up.

Bottom line: if you care about the order of stuff and want the plugin to do exactly as you say, not as the database thinks, use sort="fixed" to preserve your ordering.

[ I’m glad someone is getting use out of it, because it was a bitch to write: the database always sorts by something (id, created, name, whatever) so if you want them in a special order the plugin has to pull out all the required images, find the ones you want first, move them and then put all the rest afterwards, taking into account in which position any random attribute occurs. Aaaarghh…! ]


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

#316 2008-12-26 22:18:27

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

Re: smd_gallery: super-flexible gallery generator

Hi Bloke, thanks for the detailed reply.

Re: order of images: if you are using values just from ?article_image field, couldn’t the plugin default to the order in which IDs were entered on the article-image field?

Just to clarify: I’m not asking for this feature, but asking if it would make sense. upm_article_image works that way, at least.

BTW, in my particular case, I did have to set the sort="fixed" in two smd_gallery tags because I was also using offset and limit attributes (in different each smd_gallery tags, of course), and without the sort="fixed", the output was making no sense (looked like random output, but not even that, because it always output the same).

Thanks again.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#317 2008-12-26 22:22:52

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

Re: smd_gallery: super-flexible gallery generator

maniqui wrote:

if you are using values just from ?article_image field, couldn’t the plugin default to the order in which IDs were entered on the article-image field?

A compelling proposition; that would make sense, yes. Except you’re not limited to IDs in the article_image field. You may use categories if you wish so I’d have to test that you were using solely IDs and not categories. Or perhaps if you use article_image it does indeed — just for that field — assume a fixed order regardless. But then I’d have to find a way of allowing you to unfix that behaviour if you so desired.

Leave it with me and I’ll think about 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

#318 2008-12-31 07:35:07

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

Re: smd_gallery: super-flexible gallery generator

Greetings All,

I’m quite new to textpattern, and I’m still ‘getting a feel’ of textpattern offline. Would like some help with my ‘smd_gallery’ install. I would like to implement a ‘slide-show’ on my homepage, which picks the recent 10 images from the smd_gallery [i.e. image, title, caption e.t.c] and presents [ my inspiration comes from: http://smoothgallery.jondesign.net/ ]. I would like to implement something similar.

Second, I would like to have a section – gallery, which initially lists all sub-galleries [sub-sections], from which, when a sub-gallery is clicked, one can view slide-show of containing images, with a thumbnail list in the <div> that follows the slide-show.

Your input, help, advise will be greatly appreciated. I’m eager to implement this.


Que,
Que-Multimedia

Offline

#319 2008-12-31 11:33:18

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

Re: smd_gallery: super-flexible gallery generator

quemultimedia wrote:

I’m quite new to textpattern, and I’m still ‘getting a feel’ of textpattern offline.

Hello and welcome. Hope you like us all here. I apologise in advance that smd_gallery is a bit of a big step for newcomers and is slightly non-TXP (in its approach) but it’s fairly logical once you get your head round it.

That said, once you’ve downloaded and installed your chosen slideshow system you’ll need to feed the gallery tag to indicate you only want 10 recent images from a particular category:

<txp:smd_gallery category="my_images" limit="10" sort="date desc" />

Then you need to tell the plugin to either pass each image to a nominated form, or do what I’m going to do here and use smd_gallery as a container so each image is processed directly inside the tag:

<txp:smd_gallery category="my_images" limit="10" sort="date desc" wraptag="div" class="myGallery">
<div class="imageElement">
  <h3>{alt}</h3>
  <p>{title}</p>
  <a href="some-section/some-page?pic={url}" title="open image" class="open"></a>
  <img src="{url}" class="full" />
  <img src="{thumburl}" class="thumbnail" />
</div>
</txp:smd_gallery>

All that does is take the format given on the “getting started” page and replaces the relevant bits (the things inside {} markers) with real info from each image. The 3rd line that links to some-page to show a full-size image you would have to design yourself. I chose here to pass a pic paramater with the URL of the image so on that page you could read that variable and fashion some HTML to show the image centre-stage. You can do it however you like; that’s just an example.

Second, I would like to have a section – gallery, which initially lists all sub-galleries [sub-sections]

TXP doesn’t have sub-sections as such, but you can use image categories (or sub-categories) and smd_gallery to achieve the same thing. If you set up one article per gallery and, say, in the article_image field you give it the name of the image category you want to use in that gallery then any time you view that particular article you can use smd_gallery to read the image category and display the corresponding gallery (use category="?article_image")

Furthermore, if you do it that way, to get a “gallery of galleries” you simply need to use the <txp:article /> tag on a section list page (i.e. in your gallery page tempate inside <txp:if_article_list>...</txp:if_article_list> tags) and it will automatically show you all articles (thus galleries) in the section. If you vary your smd_gallery tag in the article list case (perhaps use a different form in the <txp:article /> tag) you can get it to show you one image from the gallery as a thumbnail that — when clicked — will take you to the individual article to see the full gallery.

It’s a little more involved than above, so experiment away with it. If you get stuck, just say.

P.S. on the forum, if you want to show code, use bc. your-code-here. I spotted you trying to use <code> on another thread but this forum uses textile.

Last edited by Bloke (2008-12-31 11:34:11)


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

#320 2008-12-31 15:55:32

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

Re: smd_gallery: super-flexible gallery generator

For anyone who missed the post on the slimbox thread, or who only keeps an imaging eye on this thread, Christophe Beyls has just unveiled Slimbox 2. It’s the same animal as before but based on jQuery instead of mootools. For those of you who love the slimbox approach but feel mucky having two js libraries lurking around, this is a great excuse to try it out with smd_gallery!

Thanks again to Christophe for his continuing top notch work.

Last edited by Bloke (2008-12-31 15:56:05)


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

#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: 11,408
Website GitHub

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

Board footer

Powered by FluxBB