Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#793 2011-01-09 22:19:08

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

Re: smd_gallery: super-flexible gallery generator

colak wrote:

well the strange thing is that it seems that it is not parsed at all even when I use

When you say ‘not parsed’, you mean that you see the actual string {title} in the HTML output? That is weird. Do any of the other smd_gallery {} substitutions get replaced with their equivalents? As Dimitri says, since smd_gallery v0.50, {caption} and {title} mean the same thing.

In your latest example, do you see images but no captions? What does the rendered HTML look like? Do you just see:

<img src="some_image" />
<br />
<img src="some_other_image" />
<br />
...

? I admit I don’t quite get what you’re doing. Are you uploading images and setting the image Caption to the url_title of an article so you can link to an article from an image?


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

#794 2011-01-10 06:59:11

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,002
Website GitHub Mastodon Twitter

Re: smd_gallery: super-flexible gallery generator

Hi Stef

No I do not see {title} in the HTML output. I have been an idiot. It is image {name} i had to use. Here is my final working code. Somehow I just couldn’t see it yesterday.

<txp:smd_gallery category="animals" sublevel="all" limit="1" sort="random"> 
<a href="<txp:site_url />{name}"><txp:image id="{id}" /></a>
</txp:smd_gallery>

Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#795 2011-02-02 19:02:50

whocarez
Plugin Author
From: Germany/Ukraine
Registered: 2007-10-08
Posts: 305
Website GitHub Twitter

Re: smd_gallery: super-flexible gallery generator

Hello Stef,

I try to start a slimbox2 gallery from one image, that should be shown in fullsize, but I only get a thumbnail as start. As far as I understand it, I have to set thumb whether to "0" or to "0:0", but neither one of these options works. In the other direction, setting both to thumbnailsize, it works.
Here is my smd_gallery tag

<txp:smd_gallery form="equipment_bild" id="?article_image" class="artikel_bild" sort="random" thumblimit="1" thumb="0" />

this is the form
<a rel="lightbox-smd" href="{url}" title="{caption}">{object}</a>

Where to look?
Thanks …

Offline

#796 2011-02-02 20:21:40

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

Re: smd_gallery: super-flexible gallery generator

whocarez wrote:

As far as I understand it, I have to set thumb whether to "0" or to "0:0", but neither one of these options works.

Ah, I think you’ve found a couple of bugs — or at least some inconsistencies which I need to address that are holdovers from versions released prior to TXP 4.2.0.

Firstly, the documentation is wrong (or the code is bugged) when it comes to single values in the thumb attribute. For reasons I cannot fathom I’m always setting the thumbnail size to the ‘t’ image if you use a single value. Stupid. So in order to set both images to the full size, you do need to specify thumb="0:0".

Secondly, it is actually working and displaying your full size image but the {object} tag doesn’t take into account the fact you’re using the full size image so it puts the thumbnail width and height into the <img> tag. Hence your images are full size but the browser is scaling them to the dimensions of the thumbs. D’oh!

The easiest way round this is to use thumbsize="200, 300" (or whatever your full size image dimensions are) to force the browser to use those sizes. Or you can build your own {object} img tag via objectform and put the dimensions in there.

I’ll have to see if I can fix these behaviour issues. Thanks for finding them and sorry the plugin was a whole heap of FAIL for you.

Last edited by Bloke (2011-02-02 20:22:10)


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

#797 2011-02-02 20:31:35

whocarez
Plugin Author
From: Germany/Ukraine
Registered: 2007-10-08
Posts: 305
Website GitHub Twitter

Re: smd_gallery: super-flexible gallery generator

Thanks for your quick response.
The problem is, that I can not define the dimensions of the thumbnail, because the pictures are very different. For example one is 212×162 and an other is 500×375. So I need either a dimension detection or empty parameters ….

Offline

#798 2011-02-02 22:54:30

lythande
Member
Registered: 2009-09-08
Posts: 202
Website

Re: smd_gallery: super-flexible gallery generator

you can do it, but you set your thumbnailsize for each image (in the content – image) to the original-size.

or maybe easier: would that do thumbnail="{width}, {height}" or not?

Offline

#799 2011-02-02 23:10:41

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

Re: smd_gallery: super-flexible gallery generator

lythande wrote:

you can do it, but you set your thumbnailsize for each image

Yes, that’s what I meant by building your own objectform. Something like this:

<txp:smd_gallery
     id="?article_image"
     class="artikel_bild"
     sort="random"
     thumblimit="1"
     thumb="0:0"
     objectform="gal_of"
     onchange="">
   <a rel="lightbox-smd" href="{url}" title="{caption}">{object}</a>
</txp:smd_gallery>

And in Form gal_of:

<img src="{thumburl}" width="{width}" height="{height}" alt="{alt}" title="{title}" />

That’ll use the full size image dimensions in your “thumbnail” (which is actually the full size image itself).

Hope that helps a little.

Last edited by Bloke (2011-02-02 23:11:45)


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

#800 2011-02-02 23:26:26

whocarez
Plugin Author
From: Germany/Ukraine
Registered: 2007-10-08
Posts: 305
Website GitHub Twitter

Re: smd_gallery: super-flexible gallery generator

lythande and bloke

Thanks!!! It works ….

Last edited by whocarez (2011-02-02 23:43:31)

Offline

#801 2011-02-04 19:12:33

fowler
Member
Registered: 2007-02-12
Posts: 79

Re: smd_gallery: super-flexible gallery generator

hey stef, I’m trying to assign the aspect ratio of a photo as a class to a surrounding div.

I’m using this sort of logic..

<div class="{aspect}"> image </div>

or

<div class="<txp:if_aspect ratio="portrait">vertical</txp:if_aspect>

( i know these don’t work… just illustrating a point )

Last edited by fowler (2011-02-04 19:22:27)

Offline

#802 2011-02-04 23:12:10

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

Re: smd_gallery: super-flexible gallery generator

fowler wrote:

I’m trying to assign the aspect ratio of a photo as a class to a surrounding div.

Hmmm, for some reason I don’t expose the aspect as a replacement. Glaring omission, unless I had jolly good reason (and for the life of me I can’t remember). Perhaps I should rectify that in the next version.

For now, if you have smd_if installed you might be able to do something like this (untested) :

<txp:variable name="aspect">
   <txp:smd_if field="{width}" operator="gt" value="{height}">landscape<txp:else />portrait</txp:smd_if>
</txp:variable>

And then use that variable in your layout. Won’t catch square images (you could extend the logic if you wished), but it might be worth a shot.

I’ll add a dedicated {aspect} replacement to the list of things to consider in the next version, thanks.

Last edited by Bloke (2011-02-04 23:12:41)


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

#803 2011-02-07 19:39:18

fowler
Member
Registered: 2007-02-12
Posts: 79

Re: smd_gallery: super-flexible gallery generator

I’ll try it out. Thanks!

Offline

#804 2011-03-03 17:05:03

hablablow
Member
From: Paris
Registered: 2004-12-13
Posts: 309
Website

Re: smd_gallery: super-flexible gallery generator

Hi Stef,

Is it possible to increment {counter} by 1 each time we have a group of 10 images in the same category ?
So for the first 10 images {counter} would output 0, for the next 10 {counter} would output 1, for the next 20 {counter} would output 2 etc…
I’m currently trying to read the value of {counter} inside a form from (fromformfromform…)

<txp:smd_gallery form="thumbs" id="?thumblist" limit="10" galleryid="category_elements" pageform="pager" 
wraptag="ul" class="thumbs noscript"  navwraptag="span" navbreak="span" navclass="ss-pagination" 
pagepos="above, below" sort="position,fixed"/>

But inside my form called “thumbs” the {counter} increments by 1 for each image…

Any help on this would be very helpful…

Thanks !

Last edited by hablablow (2011-03-03 17:07:43)


_
_I plant seeds for future visions. Farmer of your eyes. Subliminal engineer of your minds. eion founder__

Hablablow + Webdesignofficina

Offline

Board footer

Powered by FluxBB