Textpattern Forum

You are not logged in. Register | Login | Help

#381 2009-02-25 08:35:33

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

Re: smd_gallery: super-flexible gallery generator

But would it be nessary to resave very image so thumbnail sizes insert to database?


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

#382 2009-02-25 14:22:17

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

Re: smd_gallery: super-flexible gallery generator

maniqui wrote:

could you please confirm that {totalimages} always equals the limit attribute? And, if no limit, then it’s equal to the total amount of images fetched/outputted?

I concur.

  • With no limit, {maximages} equals {totalimages} equals total number of matching images from your criteria
  • With limit, {maximages} equals total number of images across all pages, and {totalimages} is equal to your limit attribute

The offset jams a slight spanner in the mechanism but I think the totals still remain true. At least, they’re supposed to. If you find they don’t please let me know.


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

Txp Builders – finely-crafted code, design and Txp

Offline

#383 2009-02-26 11:48:41

mark.adams82
Member
Registered: 2008-05-27
Posts: 14

Re: smd_gallery: super-flexible gallery generator

Hi, thanks for the great plugin – it serves me very well.
The only sticking point I am having at the moment is (possibly very stupid, but..) when I add the pageform attribute to the gallery tag, the output is fine in terms of functionality, however it is injected into the thumbnail ul and is not surrounded by li’s. This obviously breaks validation and due to styling, breaks layout.
Like I say, its probably very simple to sort out, but I’m going demented trying to work a solution. Any help greatfully received!

My tag is as follows

<ul class=“gallery”>
<txp:smd_gallery category=“wedding-gallery” form=“article_gallery” pageform=“gallery_nav” limit=“10” />
</ul>

EDIT : Looks like I have eventually answered my own question, will post solution in case it can help anyone else keep some hair:

Specify wraptag and class implicitly as attributes in the tag, rather than hard-coding the ul class=“gallery” as I did above.
>>
<txp:smd_gallery category=“wedding-gallery” wraptag=“ul” class=“gallery” form=“article_gallery” pageform=“gallery_nav” limit=“10” />

Last edited by mark.adams82 (2009-02-26 12:08:30)

Offline

#384 2009-02-26 22:33:58

progre55
Member
Registered: 2006-05-02
Posts: 642

Re: smd_gallery: super-flexible gallery generator

Bloke:

I am hard at work on my other projects (ie calendar project etc.), but to add another item to the list, I now need your brilliance regarding a slideshow gallery and how to create this effect …

I need the background of the website to change in concert with the images that are being displayed in the slideshow …. I know I can do this with flash, but I would rather not go down that road … I also know I can create this effect on a clickable image … but again this is not what I am looking for …

I am hoping you may have something in your bag of tricks :)

By the way, let me know if you need more input regarding the calendar plug in (just curious if you thought the custom date thing could be implemented soon or is this way off on your todolist) …

progre55

Offline

#385 2009-02-26 23:06:33

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

Re: smd_gallery: super-flexible gallery generator

progre55 wrote:

I need the background of the website to change in concert with the images that are being displayed in the slideshow ….

Without knowing which slideshow you are choosing it’s tough to know whether it’s possible. For an onclick solution, how about this:

<txp:smd_gallery category="some-images" class="gallchange" wraptag="div">
   <a href="{url}" rel="lightbox-{category}" onclick="showbg(this)"><txp:thumbnail id="{id}" /></a>
</txp:smd_gallery>

<script type="text/javascript">
function showbg(obj) {
   jQuery("body").css("background-image", "url("+obj.href+")");
}
</script>

That changes the background image of the body tag to the clicked image when you choose a thumbnail (it’s tiled, but that can be turned off via CSS). It also shows the lightbox effect.

Playing around with that kind of idea and jQuery might give you a bit of inspiration (maybe use onchange() so the function is called when the image changes? I’m not sure if it triggers when a slideshow makes programmatic alterations).

Alternatively, if you’re using aro_slideshow v2, it supports callbacks so you could tell it to call the showbg() function every time the image changes.

By the way, let me know if you need more input regarding the calendar plug in

Not yet, think I know what I’m doing. It’s on the list and I’m experimenting but it’s not a quick fix, sorry.

Last edited by Bloke (2009-02-26 23:07:27)


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

Txp Builders – finely-crafted code, design and Txp

Offline

#386 2009-02-27 01:59:17

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

Re: smd_gallery: super-flexible gallery generator

0.5 is getting rejected by my txp 4.0.8 installation. badly formed code is the error, and then gallery 0.46 has installed ok.

Offline

#387 2009-02-27 13:34:39

progre55
Member
Registered: 2006-05-02
Posts: 642

Re: smd_gallery: super-flexible gallery generator

Bloke:

Sorry for not including that important fact, I am using Aeron’s Slideshow

If you can elaborate a little on this one (“Alternatively, if you’re using aro_slideshow v2, it supports callbacks so you could tell it to call the showbg() function every time the image changes.”) since it is exactly what i am looking for. I need the background to change uautomatically each time the image changes.

I am using the following code:

<txp:smd_gallery category="slideshowBloke" form="slideshowBloke" combo="imagecap::'{imagedef}': { 'caption': '{title}' }" collate="1" paramdelim="::" />
<div id="show" class="slideshow">
<img src="{imagepath#1}{imagedef#1}" alt="{alt#1}" />
</div>
<script type="text/javascript">
  var data = {{imagecap}};
  var myShow = new Slideshow('show', data, {captions: true, controller: true, height: 533, hu: '{imagepath#1}', thumbnails: true, width: 800 });
</script>

Definitely understand the other issue and it taking some time. Just let me know where I can assist.

progre55

Last edited by progre55 (2009-02-27 13:54:10)

Offline

#388 2009-02-27 14:49:08

mark.adams82
Member
Registered: 2008-05-27
Posts: 14

Re: smd_gallery: super-flexible gallery generator

Is it possible to add a class (eg class=“active”) to the first item in the list?

Example: I’m using a jquery gallery and want the first thumbnail to be selected.
Obviously adding the class to the gallry form adds the class to all of the list items – this causes browsers to select different thumbnails as the selected one depending on load speed of the browser I think – no what im after!
Leaving the class out of the gallery form means none are selected – as above!

I was hoping to find a ‘firstchild’ attribute or the like, but so far no luck!

If anyone has a pointer, I would be most grateful.

Offline

#389 2009-02-27 15:04:14

jakob
Moderator
From: Germany
Registered: 2005-01-20
Posts: 1,917
Website

Re: smd_gallery: super-flexible gallery generator

Mark, you can achieve it with another of Bloke’s plugins, smd_if. I have the following to achieve this.

      <ul class="gallery"><txp:smd_gallery id="?article_image">
        <li<txp:smd_if field="{counter}" operator="is" value="1"> class="active"</txp:smd_if>><img src="{url}" width="{width}" height="{height}" alt="{alt}" title="{title}" /></li></txp:smd_gallery>
      </ul>

Alternatively you can dynamically add it using js/jquery when you load your gallery, e.g. as in this example for the jquery galleria gallery:

$("ul.gallery li:first").addClass('active');

TXP Builders – finely-crafted code, design and txp

Offline

#390 2009-02-27 15:13:35

mark.adams82
Member
Registered: 2008-05-27
Posts: 14

Re: smd_gallery: super-flexible gallery generator

Thankyou for your solution, I have no doubt it would work just fine.

I have in fact got it covered with a different solution which I will post in case it helps someone, though I appreciate your solution seems more simple.

In jquery.galleria.js

after

return this.each(function(){

I added

var firstCheck = true(){

Then ran through the variables currently assigned by default.

Adding

if(firstCheck) { _container.siblings(‘.active’).removeClass(‘active’); _container.addClass(‘active’); firstCheck=false; }

to the end of the list assigns the desired class to the first list item only.

Thankyou for your help nonetheless.

Last edited by mark.adams82 (2009-02-27 15:14:31)

Offline

Board footer

Powered by FluxBB