Textpattern CMS support forum

You are not logged in. Register | Login | Help

#571 2009-10-01 12:55:16

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

Re: smd_gallery: super-flexible gallery generator

Hi Stef,

I wonder how is it supposed to use the thumb and thumbsize attributes. I mean, if, for render output, smd_gallery uses a form (or the container tags, or a default hyperlinked full image if not form specified nor container tags), how is it supposed that those two attributes will affect the output?.

Thanks!


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#572 2009-10-01 13:29:43

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,813
Website

Re: smd_gallery: super-flexible gallery generator

maniqui

thumb determines which way round your full size image and thumb are rendered. You could conceivably switch them over so that the {url} replacement var pointed to the ‘t’ image and {thumburl} pointed to the full size. Quite why you’d do that I don’t know, but you could also set both thumb and full size image replacement vars to be the same.

With the advent of 4.2.0 thumbsize is only really of use for special effects or occasions where you might not have control over the image uploads (e.g. a community site). It was primarily designed to allow you to set the thumbnail dimensions in the default {object} replacement var. Used in conjunction with {thumb} to swap full size and thumbnail links over, this means you could set the dimensions of the full size image irrespective of what it is set to in the database. Thus you always get, say, nice square images / thumbs in your gallery. You’re right that if you use a form without {object} the attribute is useless (EDIT: remember {object} is used for showing only a subset of those thumbs you want from your entire gallery so the image tag it spits out was not configurable when the plugin was first made).

Incidentally, that was one of the reasons I avoided using the txp:image and txp:thumbnail functions in the plugin because they come with attribute baggage that might not be required on your flight. But since the objectform attribute became available you can set the widths and heights manually in that form instead, which was not possible back when thumbsize was created.

Does that kind of answer your question?

Last edited by Bloke (2009-10-01 13:33:19)


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

#573 2009-10-01 14:14:06

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

Re: smd_gallery: super-flexible gallery generator

Thanks, Bloke. Yes, it answers my question, in a more detailed level than I would have wished ;) Just kidding.
I already “know” that it swapped the replacement tags values, but somehow, I forgot it and come here to ask it. Shame on me.
Hopefully, it will help others who may be wondering the same :).

One more question. I think I’ve grasped the idea of thumblimit and {object}, just would like to confirm something. Looking at Example 9 on help docs (I’ve modified it a little to make it easier to read):

<txp:smd_gallery thumblimit="1"
     id="?article_image"
     combo="artid:?thisid">
  <a rel="shadowbox[{artid}]"
     href="{url}">{object}</a>
</txp:smd_gallery>

It means it will output something like this, right?

<a rel="shadowbox[1]" href="1.jpg"">... the thumbnail (or whatever the {object} tag renders) here ..</a>
<a rel="shadowbox[1]" href="2.jpg""></a>
<a rel="shadowbox[1]" href="3.jpg""></a>
...
<a rel="shadowbox[1]" href="10.jpg""></a>

What I would like to confirm is that it outputs related links for every image, as it’s the way most javascript galleries work out there.
In other words, there is an output (even if it’s just an empty link) for every image in the gallery, right?.

I hope it’s clear what I’m trying to ask :P
Thanks again.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#574 2009-10-01 16:31:49

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,813
Website

Re: smd_gallery: super-flexible gallery generator

maniqui wrote:

In other words, there is an output (even if it’s just an empty link) for every image in the gallery, right?.

Correct. For every image in the gallery the entire form/container is output; but {object} only outputs a thumbnail if thumblimit hasn’t been reached. The empty anchors are a simple trick to make a gallery from a single image: the images are on the page all the time, just ‘hidden’ without any thumbs or text.

BTW, since most galleries use rel to group images, thumblimit is honoured at each change in category or catgory_title so you get thumblimit thumbnails per category. And yes, the logic behind that was a bitch to get right Bo)


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

#575 2009-10-15 11:05:25

dhmax88
Member
Registered: 2009-08-30
Posts: 7

Re: smd_gallery: super-flexible gallery generator

Hi Stef,

This is very off topic but your the best person I know to ask. I’m creating a site that requires multiple sites. What I want to do is run it off one textpattern install so each site uses the same pages/forms/styles etc but I want the admins of each site to only show the articles relating to that site. Im wondering if this is possible with database tables etc…

I can’t make use of the new multi-site functionality within 4.2.0 because I’m using a shared server :(

Any ideas would be much appreciated.

Dave

Offline

#576 2009-10-15 13:14:04

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

Re: smd_gallery: super-flexible gallery generator

Dave,
you could try using the multi-site functionality on a shared hosting, or if gettng this setup right is really important for you, you should consider switching to hosting that let you set up a mult-site with TXP (like Joyent, or MediaTemple).

But if all that isn’t possible, you could try to share pages/forms/styles, as you requested. For that, you could try using cnk_versioning plugin, which creates folders/files for pages/forms/styles and then creating symlinks to those folders from every other TXP install.
For that, you will need to try if symlinks are possible, and the easiest way I know is logging to your hosting by ssh and trying the following command: ln -s a-folder-that-exists my-symlink.

Try beginning whit that, while we wait for Stef for a better answer.
Anyway, this is not the place for discussing it (so why the f*ck i’m posting this here?).


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#577 2009-10-20 23:58:25

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

Re: smd_gallery: super-flexible gallery generator

Hi,

I’m at my wits end trying to create a simple category-based gallery pulled from custom field #1 as I’ve done before. This is what I use:

<txp:smd_gallery category="?custom1">
<a href="{url}" title="{title}"><img src="{thumburl}" alt="{alt}" /></a>
</txp:smd_gallery>

…and it doesn’t ouput anything.

I copied this straight from another installation where it’s working fine. If I replace ?custom1 with an actual category name the gallery appears.

I checked over and over again, that the category is assigned to the images and correctly typed into cf#1, but no go.

Any ideas?

(Txp 4.0.8, smd_gallery 0.51, smd_lib 0.36)

Offline

#578 2009-10-21 06:24:58

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

Re: smd_gallery: super-flexible gallery generator

2 masa: maybe you should try {custom_1} (underscore)


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

#579 2009-10-21 07:47:21

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,813
Website

Re: smd_gallery: super-flexible gallery generator

masa wrote:

the category is assigned to the images and correctly typed into cf#1, but no go.

If the_ghost’s suggestion doesn’t work, try the actual name of your custom field, e.g. category="?gallery_images".


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

#580 2009-10-21 08:49:18

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

Re: smd_gallery: super-flexible gallery generator

Thanks, Victor & Stef,

{custom_1} didn’t work, but category="?gallery_images" did – hooray!

I also tracked down the reason: on the local install, where I could use custom1, I had never bothered to rename the field, so its name is actually custom1.

Offline

Board footer

Powered by FluxBB