Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#241 2008-10-15 11:50:16
Re: smd_gallery: super-flexible gallery generator
fuls wrote:
can we expect MLP plugin compatibility in near future?
Sorry, I haven’t thought much about it since you last asked. I’m such a slacker :-(
The same thing applies unfortunately: I don’t know in advance which things you are going to want to display and there are many things you could show. If you wanted to display a translated category, alt or caption, that’s perhaps possible because I could probably pre-load the necessary MLP translation array with the relevant info. But if you defined your own replacement variable as a combo I have no way of knowing what you are going to call it, so cannot pass that to MLP for translation (I don’t think… not sure if I can defer translation to a later point in time. If any MLP geniuses want to give advice on how I could do this, please shout)
I do have a development version lying around somewhere that I tried some MLP in. I think I abandoned it because it became too confusing but I may go back to it now I’ve learnt a bit more and see if anything leaps out at me. Which parts of the image info would you most want to translate? I can make those a priority and see if I can get it to work.
BTW, have you tried using snippets like that example in the help? It’s not ideal, but I’d love to know if it works.
Last edited by Bloke (2008-10-15 11:52:46)
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
#242 2008-10-15 12:02:29
Re: smd_gallery: super-flexible gallery generator
Thanks for the quick reply, you are not a slacker;)!
I didn’t try anything yet but it would be really great if you could provide some quick solution for:
Category name in form here:
<li>
{changed:category_title}
<a href=”<txp:section />/?c={category}”>
{object}
</a>
</li>
and alt title here:
<li>
<a rel=“shadowbox[{category}];options={overlayOpacity: 0.6, resize: false}” href=”{url}” title=”{alt}”>
<img src=”{thumburl}” alt=”“ />
</a>
</li>
Thanks in advance!
Offline
#243 2008-10-16 08:01:27
Re: smd_gallery: super-flexible gallery generator
Any ideas?
Thanks!
Offline
#244 2008-10-16 10:42:09
Re: smd_gallery: super-flexible gallery generator
Easy tiger! When you said “a quick solution” I didn’t realise you meant “overnight” :-)
I’ve got my head in smd_tags land at the moment — preparing the 3rd version of the core image patch — then I’m considering a coding holiday for a few days to get over it, and work on my screenplay instead. There’s only so much PHP one man can take; which is part of the reason I don’t code for a living.
When I come back (hopefully) refreshed I’ll try and make MLP my next port of call.
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
#245 2008-10-16 10:49:12
Re: smd_gallery: super-flexible gallery generator
Sorry Bloke, I’ll wait patiently :)
Thanks!
Offline
#246 2008-10-24 12:52:06
Re: smd_gallery: super-flexible gallery generator
Stef,
Your smd_gallery plugin is very powerful and very useful—thank you for creating it!
I have a question:
How complicated do you think it would be to combine smd_gallery with regular Textpattern articles in such a way that individual images are displayed in an individual article page with its own permanent URL instead of the usual sitename.url/images/###.jpg? I want to avoid reliance on JavaScript to display each individual image along with its associated information such as title and caption.
I am looking for a way to make a Textpattern article be the thumbnail index page of a photographic essay that you would find at a URL such as: sitename.url/stories/essayname (your plugin is great for this), and when each photograph is clicked, the visitor is taken to an individual article page with a permanent URL containing the photograph, such as: _sitename.url/stories/essayname/photo-1
I can currently accomplish something close to this by inputting each photograph ID into an specific article image ID field, and am wondering if there is a quicker, simpler way by using your plugin perhaps combined with others.
This is what I have currently: http://simongriffee.com/lp/libero-pensiero (photos ‘manually uploaded’, not using your plugin for thumbnails, necessary for me to create a section for each ‘essay’ manually)
This is the kind of thing I’m aiming for: http://www.johnvink.com/story.php?title=Cambodia_March_of_the_Damned (notice the paged thumbnail list for each essay and permanent link for each photograph).
Any suggestions are very welcome indeed!
Offline
#247 2008-10-24 19:50:30
Re: smd_gallery: super-flexible gallery generator
spgriffee wrote:
How complicated do you think it would be to combine smd_gallery with regular Textpattern articles in such a way that individual images are displayed in an individual article page with its own permanent URL
If I’ve understood correctly, this is a bit tricky. Just to get this clear in my head, the current process you have employed is:
- upload images into an image category
- create an article with the title of the image
- assign the image ID to the article image field
- use TXP tags to display the article image thumbnails such that, when clicked, they open the article in question which displays the full image via a TXP form
And you want to:
- upload images into an image category
- use smd_gallery to display the image thumbnails from a particular category such that, when clicked, they direct the browser to a URL that looks like an individual article but isn’t
Is that a summary of what you are trying to achieve? If so I’m not sure it’s possible cleanly with just tags. Certainly the plugin can be used to formulate a link to pretty much any URL, provided it is made up of bits of stuff held against an image (plus any fixed text of course). But without an actual article, you’ll get a 404 when you click on the thumb. For example:
<txp:smd_gallery category="lp">
<a href="/{category}/{name}" title="{title}">
<img src="{thumburl}" alt="{alt}" />
</a>
</txp:smd_gallery>
Provided you set up your filenames without an extension in them, that’ll redirect to, for example, /lp/name-of-my-picture.
The only way round this I can think of is to use mod_rewrite to intercept the ‘fake’ URL (e.g. detect if you get a 404), pass the ‘title’ (image name) part of the URL to a single, known, real article which reads that bit of info and fetches the image of the same name from the database to display.
Whether you could add the navigation links from this page (next/prev) I don’t know because you’re essentially always viewing the same article! Perhaps smd_query or one of the neighbour plugins can get the next/prev image in sequence?
Past that I’m out of ideas. If anyone else has some cool nuggets to help out, please chime in, thanks.
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
#248 2008-10-25 11:15:34
Re: smd_gallery: super-flexible gallery generator
Stef,
Thank you very much for addressing my question in so much detail.
I think you understand what I am after and I appreciate your ideas. I’ll probably need to give it more thought as I think the mod_rewrite interception stuff will get too unwieldy and complicated with the amount of images and articles I’ll be dealing with.
I imagine what I’m after is a system where when images are uploaded, articles with image titles, captions, category and image IDs are automatically generated. Then either I create another article as the ‘index page’ for these articles with thumbnails or this is also automatically generated.
I’ll keep thinking.
Thanks again for your time!
Simon
Offline
#249 2008-10-26 11:15:50
Re: smd_gallery: super-flexible gallery generator
I cant download the file. :( My ISP is crap.
Can someone email me the plugin at nemanja@plumts.com .
Thanks!
“… they were enterprising voyages…” – Mr. Spock ( from Spock vs. Q )
Offline
#250 2008-10-26 12:04:08
Re: smd_gallery: super-flexible gallery generator
Can someone email me the plugin at nemanja@plumts.com
Done, and you are most welcome.
Offline
#251 2008-10-26 12:08:31
Re: smd_gallery: super-flexible gallery generator
sirNemanjapro
You got mail :-)
EDIT: joebaich beat me to it. Oh well, you have two copies now!
spgriffee
I agree the mod_rewrite might become a little awkward over time.
when images are uploaded, articles with image titles, captions, category and image IDs are automatically generated.
Yes, that would sort you out. I don’t know of any plugin that can help in this regard at the moment as it is quite a specific requirement.
May I ask what your primary aim is of wanting each image to have its own URL? Is it so the URL can be e-mailed in a more human friendly (or direct linked) nature?
Just as another mod_rewrite aside, instead of having a section for each story, what if you were to put all the ‘stories’ in a section and have one ‘index’ article for the name of the story (e.g. site.com/stories/lp, site.com/stories/felb, etc). On each story article you have an smd_gallery call that generates the thumbnails based on the name of the article (attribute category="?title"). Your smd_gallery form/container is a modification to the idea in my post above that formats the image URL links like this:
site.com/stories/lp/name-of-pic-goes-here
mod_rewrite steps in the way and (behind the scenes) changes any URL in the ‘stories’ section to:
site.com/stories/lp/?pic=name-of-image-goes-here
In your article you employ the smd_if plugin to detect if the pic urlvar has been supplied and if it has, display the relevant picture/caption instead (perhaps use upm_image for this?), then the smd_gallery as usual to show the thumbs below it.
It cuts down your workload to:
- create image category
- upload pictures to new category (use fpx_image_import for multiple uploads at once)
- creat article with the same name as the image category, perhaps override it with a form
- use the same form for every article in the ‘stories’ section that does the smd_if/gallery stuff
Does that give you any further ideas or is it still too complicated to manage?
Last edited by Bloke (2008-10-26 14:59:05)
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
#252 2008-10-29 02:17:22
- curiouz
- Member

- Registered: 2006-06-20
- Posts: 56
Re: smd_gallery: super-flexible gallery generator
Hi Bloke,
I’m trying to make a Slideshow2! gallery with captions. Every image needs to link to a shadowbox modalbox with a different individual article as inline content.
I got the captions to work, by setting the paramdelim to “|” and making the following combo:
combo="test|'{imagedef}': {caption:'{title}'}"
wich generates
'1.jpg': {caption:'bla'}, '2.jpg': {caption:'blabla'};
Now my problem is the links to the articles. I tried changing the combo to:
combo="test|'{imagedef}': {caption:'{title}', href:'{somecombo}'}"
but comma’s don’t work in combo’s.
I’ve tried changing the form to:
<div class="slideshow" id="show"><a href="{somecombo}" rel="shadowbox"><img src="<txp:site_url />images/{id#1}.jpg" alt="{alt#1}" /></a></div>
but ofcourse in “collate” mode the href is generated something like this: http://someurl.com/bla, bla2, bla3, bla4
Do you have any idea how to get this working?
Offline
#253 2008-10-29 09:14:44
Re: smd_gallery: super-flexible gallery generator
Stef,
Bloke wrote:
May I ask what your primary aim is of wanting each image to have its own URL? Is it so the URL can be e-mailed in a more human friendly (or direct linked) nature?
That is correct. I would like each image to have its own URL so that a direct link to the image along with its associated information is possible. Also, I want this URL to be visible and accessible without the use of JavaScript.
Just as another mod_rewrite aside, instead of having a section for each story, what if you were to put all the ‘stories’ in a section and have one ‘index’ article for the name of the story (e.g.
site.com/stories/lp,site.com/stories/felb, etc). On each story article you have an smd_gallery call that generates the thumbnails based on the name of the article (attributecategory="?title"). Your smd_gallery form/container is a modification to the idea in my post above that formats the image URL links like this:
site.com/stories/lp/name-of-pic-goes-here
mod_rewrite steps in the way and (behind the scenes) changes any URL in the ‘stories’ section to:
site.com/stories/lp/?pic=name-of-image-goes-here
In your article you employ the smd_if plugin to detect if the
picurlvar has been supplied and if it has, display the relevant picture/caption instead (perhaps use upm_image for this?), then the smd_gallery as usual to show the thumbs below it.
This sounds very interesting. Let me see if I have it right:
1) With each image category I create and upload images to, I also create an article with the same name as the category which serves as the thumbnail index (let me call this ‘story-name’ for now). All these articles are set to a Stories section.
2) When a visitor goes to site.com/stories/story-name and clicks on a thumbnail, a mod_rewrite rule adds the pic variable to the clicked link.
3) In the article itself or in an article form which controls the display of this article, the presence of the pic URL variable in each thumbnail link is tested using the smd_if plugin, and if it is present, when the link is clicked the visitor is taken to site.com/stories/story-name/?pic=name-of-image which is a permanent URL for the particular image which is shown in the page with its caption and title without the use of JavaScript to generate the HTML.
4) The visitor can click on the image itself to be taken back to the index page, or on next and previous links to go to the next or previous image in the series, and maybe even have paging functionality so they can go to the 2nd page, last page, and so on.
I realize that #4 above may add to the trickyness, but overall I think this could work. A couple of things I’d want to think about would be:
A) Breaking other parts of the site with the .htaccess mod_rewrite rule, though I might by able to figure this out. Do you have any tips on how to write the rule itself?
B) Performance hit. Any idea how much slower would the site be with all the smd_gallery and mod_rewrite stuff going on in the background?
Does that give you any further ideas or is it still too complicated to manage?
It does give me more ideas and I’m going to try and see! Thank you Stef!!
Offline
#254 2008-10-31 01:49:56
- mlarino
- Member
- Registered: 2007-06-29
- Posts: 367
Re: smd_gallery: super-flexible gallery generator
man, this plugin is complicated, or at least I can figure it out…
I am trying to create a gallery of all the thumbnails in category “galeria” to be shown in a section.
But any smd tag I use just renders every full size image in that category.
I am trying to make those thumbanils link to the full size image using lightbox.
anyone can help?
thanks!
Offline
#255 2008-10-31 14:23:36
Re: smd_gallery: super-flexible gallery generator
mlarino wrote:
man, this plugin is complicated, or at least I can figure it out…
I don’t do things by half :-)
But any smd tag I use just renders every full size image in that category.
OK, this is probably (I’m guessing) because you’re not using the plugin as a container or with the form attribute. Without those, it drops into a “default” mode which displays every full size image from the given category.
The 2nd half of Example 1 in the plugin help is what you need to do. I’m not sure which lightbox effect you are using (let’s assume the original lightbox):
<head>
<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects,builder"></script>
<script type="text/javascript" src="js/lightbox.js"></script>
<link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />
</head>
Then add your gallery tag to a form, or somewhere in your default article for the desired section:
<txp:smd_gallery category="galleria">
<a rel="lightbox" href="{url}" alt="{alt}"
title="A picture of {title}">
<txp:thumbnail id="{id}" />
</a>
</txp:smd_gallery>
(sorry, ignore the width and height attributes on the anchor in Example 1: I still haven’t fixed that in the documentation)
That renders an anchor tag for every image in the galleria category, sets it to use lightbox to display, and inside each anchor puts the relevant thumbnail. Then you use CSS to style it all and lay it out, float it, however you wish.
Does that get you started? Give me a shout if you need any more info.
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