Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#241 2008-10-15 11:50:16

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

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.

Txp Builders – finely-crafted code, design and Txp

Offline

#242 2008-10-15 12:02:29

fuls
Member
Registered: 2005-11-16
Posts: 117
Website

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

fuls
Member
Registered: 2005-11-16
Posts: 117
Website

Re: smd_gallery: super-flexible gallery generator

Any ideas?
Thanks!

Offline

#244 2008-10-16 10:42:09

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

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.

Txp Builders – finely-crafted code, design and Txp

Offline

#245 2008-10-16 10:49:12

fuls
Member
Registered: 2005-11-16
Posts: 117
Website

Re: smd_gallery: super-flexible gallery generator

Sorry Bloke, I’ll wait patiently :)
Thanks!

Offline

#246 2008-10-24 12:52:06

spgriffee
Member
Registered: 2004-12-21
Posts: 38
Website

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

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

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:

  1. upload images into an image category
  2. create an article with the title of the image
  3. assign the image ID to the article image field
  4. 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:

  1. upload images into an image category
  2. 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.

Txp Builders – finely-crafted code, design and Txp

Offline

#248 2008-10-25 11:15:34

spgriffee
Member
Registered: 2004-12-21
Posts: 38
Website

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

sirNemanjapro
Member
From: Čačak, Serbia
Registered: 2007-12-08
Posts: 59
Website

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

joebaich
Member
From: DC Metro Area and elsewhere
Registered: 2006-09-24
Posts: 507
Website

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

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

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:

  1. create image category
  2. upload pictures to new category (use fpx_image_import for multiple uploads at once)
  3. creat article with the same name as the image category, perhaps override it with a form
  4. 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.

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

Board footer

Powered by FluxBB