Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#565 2009-09-25 20:20:51

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

Re: smd_gallery: super-flexible gallery generator

mlarino

Glad you got the first part of your problem sorted.

{navnextpageurl} outputs the RAW URL, so the attribute “emptyclass” is useless here…

Yes, if you roll your own navigation that’s what will happen :-(

Can smd_if or the COUNTFORM help me in creating pages with different thumbnail limits?

I don’t think either can help (though I haven’t tried) because you need to know the limit before the container/form is parsed. Plus the number of images per page varies depending on which page you are viewing. Currently the replacement variables and stuff are only set up inside the container/form, so once your limit is set, that’s it. I’ll have a think about it, but…

is there anything you cant do with this plugin?

Yes, currently this request ;-)


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

#566 2009-09-27 14:18:59

mlarino
Member
Registered: 2007-06-29
Posts: 367

Re: smd_gallery: super-flexible gallery generator

Thanks Bloke!

All I need to know is that in the first and last page there will be one navigation button, and the rest will have 2.
I will keep trying.

There is no way to use the normal navigation buttons with customized images right? that will be even more helpfull.
:)

Offline

#567 2009-09-28 14:55:25

decoderltd
Member
From: London
Registered: 2006-06-20
Posts: 248
Website

Re: smd_gallery: super-flexible gallery generator

Hi,

I’m using smd_gallery and smd_if on a site and I’ve added a few conditional if statements as you’ll see below. I’ve run into a problem with one particular option, basically I want specfic images to appear depending on the section and this works fine. However there’s a category within one of the sections (testimonials) which needs it’s own image so I’ve tried to use if_category without any success, does anyone have any ideas on how I can get it to work?

In addition, it would be handy to have a generic image that was used if none of the conditions are met, but I can’t use another <txp:else /> tag. Is there another way to achieve this? Thanks.

<txp:smd_if field="article_image" operator="isused">
   <txp:smd_gallery id="?article_image" wraptag="div" html_id="fade" class="pics" >
   <txp:image id="{id}" />
   </txp:smd_gallery>

<txp:else />

   <txp:if_section name="garden-notebook">
     <txp:image id="12" />
   </txp:if_section>

   <txp:if_section name="services">
     <txp:image id="13" />
   </txp:if_section>

   <txp:if_section name="resources">
     <txp:image id="14" />
   </txp:if_section>

   <txp:if_category name="testimonials">
     <txp:image id="14" />
   </txp:if_category>

</txp:smd_if>

Offline

#568 2009-09-28 15:03:29

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

Re: smd_gallery: super-flexible gallery generator

decoderltd

Does if_article_category help? Or are you not dealing with an article in this case? if_category only triggers if you’re using /category/name (or ?c=name) in the URL.

As for the default option, at the expense of using another plugin you could try smd_multi_choice which has the benefit of being able to handle all your if_section stuff below and the default case as well.


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

#569 2009-09-28 15:43:02

decoderltd
Member
From: London
Registered: 2006-06-20
Posts: 248
Website

Re: smd_gallery: super-flexible gallery generator

Perfect, thanks Stef, the if_article_category tag worked. Must have a look at smd_multi_choice, don’t you ever sleep!

Offline

#570 2009-09-28 15:53:20

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: smd_gallery: super-flexible gallery generator

Stef is not an actual human person. He is more of a Mechanical Turk, continually spinning out — inter alia — code, advice, and strange photographs, to the wonderment of all.


Code is topiary

Offline

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

maniqui
Member
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: 11,448
Website GitHub

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
Member
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: 11,448
Website GitHub

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
New 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
Member
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

Board footer

Powered by FluxBB