Textpattern Forum

You are not logged in. Register | Login | Help

#21 2008-03-17 20:30:04

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,821
Website

Re: smd_gallery: super-flexible gallery generator

secundar wrote:

Ok, I gave it one last try with asy_wondertag as you recommended… But it does not render the gallery images,

Ah yeah, bogus info again, sorry I’m half asleep. I wonder if the <img> or <a> tags will render full server images if given file:// as a prefix. I have no idea, but you can try it if you like.

The tag simply doesn’t like directory=“http://…”

That may be your server setting. A number of hosters disable fopen_url and it’s equivalents in an effort to try and thwart security attacks. Often misguidedly, imo, but that’s another story.

Sounds like, until I get my act together with the directory option (i.e. find a host who has fopen_url enabled, or just ditch support for directories), the images tab is the easiest way to manage pics in this case. Set up a category called ‘gwar’ and dump all your pics in there.

What I want to do is present the thumbnail index, then, clicking on a thumbnail will bring up a page (no popup) with the full-size image, with next and previous navigation below.

Hmmm, you mean, like this, but with thumbnails instead of text links ? (that site’s not currently made in TXP unfortunately).

I’m not sure any gallery script will handle that because it spans two pages. I messed about with conditionals and offsets and passing URLs around; I came close (very close) with smd_gallery but couldn’t quite get it to work (in fact I think I’ve uncovered some strangeness in the offset calculation but I’m not sure yet – if I find it’s a bug and fixing it helps in this case I’ll post this example as an extreme case of how mad you can get with smd_gallery!)

So I think if you want that sort of gallery you’ll probably have to resort to some PHP, pass the URL (or ID) of the image you want to display to the address bar, read it in and display it. Navigation will probably have to be done by hand as well, but that’s just my gut reaction. Someone else might be able to come up with a good way of doing it.

I’d suggest saving yourself some hassle and using a lightbox or similar gallery to “keep it all on one page” and navigate within the lightbox. Since you only want next/prev then it’s ideal, plus the thumbnails are always a click away behind the main image so your prospective visitors can jump around in the gallery as well.

Sorry it’s not exactly the answer you’d like. If I find a way of doing it neatly I’ll yell. In the meantime I’ll rebadge the smd_gallery description as something less glamorous so people don’t get their hopes up in future on the back of my half-assed coding! :-)

Last edited by Bloke (2008-03-17 20:30:31)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#22 2008-03-17 22:31:30

secundar
New Member
From: Pittsburgh
Registered: 2004-06-02
Posts: 7
Website

Re: smd_gallery: super-flexible gallery generator

Hey Stef, thanks so much for your thoughts…Yes, just like you have it on your site but I’m going to take your advice and try one of the pop-up options — hopefully something lightweight. I’ll update this thread when it’s up so you can see a couple shots of Gwar.

Some nice photos on your site BTW. I had a laugh, thanks!

Offline

#23 2008-03-21 03:47:25

nardo
Member
From: tuvalahiti
Registered: 2004-04-22
Posts: 739

Re: smd_gallery: super-flexible gallery generator

great work bloke

any chance of a <txp:smd_gallery id="?custom_field" ... />

tried using asy_wondertag to wrap around tag & injected txp:custom_field tag into the ID attribute – but no success immediately

Offline

#24 2008-03-21 15:32:17

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,821
Website

Re: smd_gallery: super-flexible gallery generator

nardo wrote:

any chance of a <txp:smd_gallery id="?custom_field" ... />

D’oh! It was working up until the mod to v0.31 where I messed up the SQL query. Give 0.33 a go instead [ compressed ].

Sorry about that, thanks for spotting the bug.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#25 2008-03-23 19:10:16

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

Re: smd_gallery: super-flexible gallery generator

Hi,
Great plugin!
I’m having a problem with the launch from one image.

This is my plugin tag:

<txp:smd_gallery category=“animals”
sublevel=“all” form=“gallery” thumblimit=“1” />

Form:

<a rel=“shadowbox[{category}]” href=”{url}” alt=”{alt}” title=”{category_title}: {title}” height=”{height}” width=”{width}”>
{object}
</a>

Form outputs the following code (there are currently 2 photos in this category):

<a rel=“shadowbox[Animals]” href=“http://my-site.com/images/12.jpg” alt=“Image” title=“Animals:Image” height=“595” width=“800”>
<img src=“http://my-site.com/images/12t.jpg” alt=“Image” />
</a>

<a rel=“shadowbox[Animals]” href=“http://my-site.com/images/11.jpg” alt=“Image” title=“Animals: Image” height=“587” width=“800”>
</a>

As you can see the second link is empty and it is causing me some problems. I see all the css styling for the link (background color, border), and of course no image.
What can I do to remove that?
I’m also getting validation output errors:

there is no attribute “alt”.
there is no attribute “height”.
there is no attribute “width”.

Thank you very much for your help!

Offline

#26 2008-03-23 19:46:01

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,821
Website

Re: smd_gallery: super-flexible gallery generator

fuls wrote:

I’m having a problem with the launch from one image.

Ha! That would be my fault. The example is wrong (stupid copy ‘n’ paste error that I messed up). The validator is right: take out the alt=, height= and width= from the <a> tag.

You may also find that fixes the CSS, although it is a side-effect of the way the {object} tag works. What it does is “hides” the other images by not putting anything inside the anchor. I suggest what you do is wrap the smd_gallery call with a div (or use wraptag / class attributes) then change your CSS so it targets the img inside the anchor. That way, you’ll only be applying the CSS rule if the img is present.

So something like:

<div class="thumbs">
 <txp:smd_gallery blah blah />
</div>
.thumbs img {
  width:100px;
  background:#555;
...
}

Sorry about the bogus example in the help. I’ll fix that as soon as I can.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#27 2008-03-23 22:05:38

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

Re: smd_gallery: super-flexible gallery generator

Great, it works now! Thanks.

Offline

#28 2008-03-23 22:40:10

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: smd_gallery: super-flexible gallery generator

I liked this plugin too :)
P.S. Should you add link to 0.33 to the head of topic?


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#29 2008-03-24 15:13:18

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,821
Website

Re: smd_gallery: super-flexible gallery generator

@fuls: excellent. Sorry about the poor documentation.

@the_ghost. Oops, thanks for pointing that out. Updated now. I’d forgotten to update textpattern.org too.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#30 2008-03-25 12:59:29

nardo
Member
From: tuvalahiti
Registered: 2004-04-22
Posts: 739

Re: smd_gallery: super-flexible gallery generator

how do you output the thumbnail’s width and height (into the img tag) when thumbnails can be different sizes?

e.g. you wanted to approximate something like this – where your landscape and portrait thumbs sat centered in a slide frame

Offline

Board footer

Powered by FluxBB