Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#796 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

#797 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

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

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,443
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.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#799 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

#800 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

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

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,443
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.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#802 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

#803 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

#804 2011-03-07 09:30:17

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

Re: smd_gallery: super-flexible gallery generator

I’m not sure if this is possible anyway… Argh, lost.

Last edited by hablablow (2011-03-07 09:33:20)


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

Hablablow + Webdesignofficina

Offline

#805 2011-03-07 10:41:26

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,443
Website GitHub

Re: smd_gallery: super-flexible gallery generator

hablablow wrote:

Is it possible to increment {counter} by 1 each time we have a group of 10 images in the same category ?

Not sure if it’s possible (slash a good idea) to modify the in-built counters but I don’t see why you couldn’t utilise a countform like this:

countform="smd_every:10:inc_counter"

And inside your inc_counter form use rvm_counter or adi_calc to increment a txp:variable which you then use in your main smd_gallery form/container.

To make the counter work per category I would guess if you were ordering by category and reset the counter to 0 each time there’s a change in category (perhaps in an onchangeform?) that would go some way to making it behave in a way that meets your goal.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#806 2011-03-07 11:00:00

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

Re: smd_gallery: super-flexible gallery generator

This sounds great Stef…

I will return with ze rezults…

<txp:super-flexible_thanks />

Last edited by hablablow (2011-03-07 11:00:57)


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

Hablablow + Webdesignofficina

Offline

#807 2011-03-15 23:48:49

kstewart
Member
Registered: 2011-03-09
Posts: 71
Website

Re: smd_gallery: super-flexible gallery generator

Hi there,

This is probably very simple but can’t seem to get it to work… looking for an easy image slider which fades into each image nicely. I’ve uploaded your plugin and am amazed at all you can do with it! Bit overwhelming for a total noob like me! I’m wondering if it’s because I don’t have the mootools.js? Is that installed in texpattern as default? I’m not getting any notices saying javascript not found… so could be something else?

I’ve got a form entitled gallery with following code:
<div class=“slideshow” id=“slideshow1”> <img src=”<txp:txp:www.kimstewart/textpattern-4.3.0/images/{id#1}.jpg” alt=”{alt#1}” width=”{width#1}” height=”{height#1}” />
</div>

Then I’ve got an article with the following code:
<txp:smd_gallery category=“sigma 6” form=“gallery” combo=“imglist:{id}{ext}” collate=“quote:{imglist}:{alt}” />

(Only have two images in sigma 6 category so far… could this be the reason?

Also in pages head:
<script type=“text/javascript” src=”/js/mootools.js”></script>
<script type=“text/javascript” src=”/js/slideshow.js”></script>

Apologies for such a simple question… I know I’m missing something really obvious but still getting used to textpattern.

Many thanks in advance for any help given!


www.kimstewart.co.uk

Offline

#808 2011-03-15 23:55:44

kstewart
Member
Registered: 2011-03-09
Posts: 71
Website

Re: smd_gallery: super-flexible gallery generator

Sorry, shoulda posted my site url:
http://www.kimstewart.co.uk/textpattern-4.3.0/

(I’d like the slideshow to appear where the static image currently is.)


www.kimstewart.co.uk

Offline

#809 2011-03-16 00:14:07

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,443
Website GitHub

Re: smd_gallery: super-flexible gallery generator

kstewart wrote:

Bit overwhelming for a total noob like me!

Hehe, sometimes it overwhelms me, so you’re not alone :-)

I’m wondering if it’s because I don’t have the mootools.js?

If I view the source of your page and click the /js/mootols.js link I get a 404, so that would certainly be part of it. Once you alter your link to point to the actual mootools.js file you’ve uploaded to your server you’ll be one step closer. jQuery is installed by default in Textpattern so if you can find a slideshow script that uses jQuery then all you need to do is load jQuery with:

<script type="text/javascript" src="<txp:site_url />textpattern/jquery.js"></script>

and upload / install the relevant scripts that come with the slideshow. I can heartily recommend jQuery Cycle (or even CycleLite if you only need simple transitions).

<img src=”<txp:txp:www.kimstewart/textpattern-4.3.0/images/{id#1}.jpg”

That doesn’t quite look right. You should have {http://}www.kimstewart…

The slideshow output is the most complex one to start with so if you can get the functionality you require with a simpler plugin (like Cycle) then I’d go with that first. But if you really need the power of slideshow it’s not insurmountable, just a little picky. Post back here with your findings/thoughts and we’ll go from there.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#810 2011-03-16 12:30:47

kstewart
Member
Registered: 2011-03-09
Posts: 71
Website

Re: smd_gallery: super-flexible gallery generator

Thank you so much! Cycle Lite’s worked perfectly! Also it’s easy to update images and alter their size. (Though I prefer them all to be the same size so will resize them later).

Now I just have to fix my video gallery and I’ll have the site I want! Cheers!


www.kimstewart.co.uk

Offline

Board footer

Powered by FluxBB