Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#157 2008-07-10 08:46:50

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

Re: smd_gallery: super-flexible gallery generator

fuls wrote:

Thanks. What about category_title and MLP?

MLP is not supported directly at the moment, sorry. It’s on the TODO list but I couldn’t figure out the best way to handle it. See, there’s so much stuff you could output — and you can define your own stuff via combo — so I’m not sure how it would work.

I think you can MLPise the labels via snippets (there’s an example in the help, though it’s untested so I’m not sure it works). Perhaps you could try the same sort of thing and use a snippet here as a temporary workaround?

If you have any thoughts on what parts of the interface should go through MLP I’ll look into adding 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

#158 2008-07-10 10:22:16

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: smd_gallery: super-flexible gallery generator

Hi BLoke,
probably you already read it, anyway these are Steve’s suggestions for building mlp compatibles plugins.

Offline

#159 2008-07-10 10:26:31

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

Re: smd_gallery: super-flexible gallery generator

I need to keep onchange, so how would you suggest to use combo with onchange? I need to create a new replacement tag and
put it instead of category_title and it should be a ##snippet##. How:)?
Thanks!

Offline

#160 2008-07-10 10:47:39

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

Re: smd_gallery: super-flexible gallery generator

fuls wrote:

how would you suggest to use combo with onchange?

Any combo can be used with onchange so every time it’s different it will trigger.

But honestly, I’m not sure how to do it. It was just a thought off the top of my head. It depends how many categories you have because it could be a little labour intensive. All I wondered was whether you might be able to do this:

<txp:smd_gallery combo="mycat:##cat_title_{category}##" other="" options="" here="" />

And then in your form use onchange:mycat. You’d have to manually set up snippets called cat_title_lions, cat_title_tigers and so on — where the last part matched your categories — which is not ideal and why I suggested it only as a temporary measure. But that (or something similar, perhaps generate the snippet name in the form?) might work and get you going until I have time to work out how to make smd_gallery work with MLP properly.

redbot

Yeah I know about the mechanism for doing it, but thanks for the link. In fact, it’s even easier than that now both me and Steve have MLP wrappers in our libraries. The problems I have are:

  1. My MLP wrapper is in smd_lib but I don’t really want to have smd_gallery reliant on smd_lib; although there’s a lot of duplication in the two anyway so perhaps I should
  2. Ideally I’d like to make the plugin detect if smd_lib or Steve’s wrapper is enabled and only offer MLP support if so. I haven’t figured out how to do that yet so it gracefully falls back to “no MLP
  3. I don’t know which of the replacement variables to put through MLP. Potentially it could be all of them, which is a lot of extra code. And what do I do if you define your own combos? I don’t know how to put those through the MLP machine because I need to supply “default” values in the plugin but I can’t supply defaults if I don’t know what your combos are going to be called :-)

That’s the main reason why smd_slimbox has MLP support but smd_gallery doesn’t (yet); slimbox has defined output but gallery does not. Any ideas from anyone gladly welcomed.

Last edited by Bloke (2008-07-10 10:48:35)


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

#161 2008-07-10 18:21:29

immarabi
Member
Registered: 2008-04-29
Posts: 57

Re: smd_gallery: super-flexible gallery generator

Hello again. Trying to sort my thumbnails from latest to oldest. this is what I tried:

<txp:smd_gallery category="?s" form="gallery" sort="id,desc" />

thanks again

Offline

#162 2008-07-10 18:37:57

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

Re: smd_gallery: super-flexible gallery generator

immarabi

So very close! Try a space instead of a comma:

<txp:smd_gallery category="?s" form="gallery" sort="id desc" />


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

#163 2008-07-11 14:33:07

immarabi
Member
Registered: 2008-04-29
Posts: 57

Re: smd_gallery: super-flexible gallery generator

Great, thanks that works now. One more question though . .
How can I display the {alt} text when the mouse hovers over the thumbnail in both Firefox and Explorer? Right now when the mouse hovers over the thumbnail it displays the {title} text which is the same as is displayed in the caption under the full sized version using the lightbox effect (which is where I want the {title} text to go and go only.)

here is my gallery form:

<a rel="lightbox-{category}" href="{url}" alt="{alt}"
     title="{title}" >
 <txp:thumbnail id="{id}" alt="{alt}" />
</a>

thanks again!

Last edited by immarabi (2008-07-11 14:34:08)

Offline

#164 2008-07-11 14:40:53

masa
Member
From: Asturias, Spain
Registered: 2005-11-25
Posts: 1,091

Re: smd_gallery: super-flexible gallery generator

As far as I know, displaying the alt text is one of IE’s non-standards conformant behaviours. If there’s a title attribute, that’s what the browser should display.

So I’m afraid, what you want might not be possible.

Offline

#165 2008-07-14 12:55:10

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,306

Re: smd_gallery: super-flexible gallery generator

Stef, is it possible to give any of the navigational elements a focusing JS like Google’s document.f.q.focus()? My client is fond of keyboard accessibility. Maybe it’s sufficient to do a one-line-mod? :)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#166 2008-07-14 13:04:26

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

Re: smd_gallery: super-flexible gallery generator

uli wrote:

is it possible to give any of the navigational elements a focusing JS

That’s kind of outside the scope of the plugin (in a sense) because it leads to all sorts of other things like shortcut keys and stuff that’s difficult to do generically.

If you just want the page to jump to a particular nav element when it loads, you can do it with some jQuery. Give a class / ID to the item you want to have focus and add this to your page (inside script tags of course!) :

jQuery(function() {
  jQuery("#element_ID_that_requires_focus").focus();
});

If you decide to use a class instead of an ID, swap the # for a . in the above.

Does that help or have I misunderstood your request?

Last edited by Bloke (2008-07-14 13:05: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

#167 2008-07-14 13:13:54

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

Re: smd_gallery: super-flexible gallery generator

There’s a new version out, btw. v0.45 [ zipped ] fixes a small issue if you have not assigned a category to your images. Under those circumstances the plugin returned nothing, which is clearly bogus.

Thanks to robin746 for highlighting this and giving me time on his server to debug this oversight.


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

#168 2008-07-14 13:19:28

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,306

Re: smd_gallery: super-flexible gallery generator

Thanks, Stef!
No, no misunderstanding :)

However, it doesn’t work. I put this into the head section of my page:

<script language="JavaScript" type="text/JavaScript">
<!-- jQuery(function() {
  jQuery("#tab_test").focus();
}); //-->
</script>

And this in my form:

<div ID="tab_test" >{navnext:>}</div>

Even when I put the jQuery immediately before the element (into the form) nothing gets the focus.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

Board footer

Powered by FluxBB