Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#436 2009-03-27 13:56:09

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

Re: smd_gallery: super-flexible gallery generator

Yay; got there in the end!

mlarino wrote:

anyway to exclude the first image in the article image from the slideshow?

Erm, not really, unless you know the image ID then you can hard-code it to be excluded (using the ! terminology in your id attribute)

Can you perhaps remove the image from the list in the first place? Look at what you are telling the gallery plugin to do: “read my article_image field and make a gallery out of all the images you find there”. Why would you want to go to the trouble of adding an image ID to your slideshow that you don’t want in your slideshow?!

Are you using the first image for something else? If so, what? A thumbnail? Can this image ID be moved elsewhere? Or can your list of images that you do want in your slideshow be moved to a custom field to leave the article_image with a single ID that you use for a thumbnail?

You could always put the ID of the image you don’t want in a custom field called exclude_image and do this: id="?article_image, !exclude_image" but why you would want to do that when it is simpler to just omit the ID of the unwanted image in the first place, is beyond me!


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

#437 2009-03-27 16:58:19

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

Re: smd_gallery: super-flexible gallery generator

Can smd_gallery output thumbnails’ width\height neither this info is absent in db? Can is parse it with php?


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

#438 2009-03-27 17:12:50

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

Re: smd_gallery: super-flexible gallery generator

the_ghost wrote:

Can smd_gallery output thumbnails’ width\height neither this info is absent in db?

Not yet, although it’ll output any fixed width/height you give it via the thumbsize attribute (which is not much use!)

Can is parse it with php?

It could get the info via PHP but it doesn’t. And from now on (SVN) I won’t have to because the thumb dimensions are in the DB. So I’m hoping to put this request off for a while until TXP 4.0.9 is released whereby I can do it natively with almost no extra code ;-)


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

#439 2009-03-27 17:27:32

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

Re: smd_gallery: super-flexible gallery generator

And from now on (SVN) I won’t have to because the thumb dimensions are in the DB. So I’m hoping to put this request off for a while until TXP 4.0.9 is released whereby I can do it natively with almost no extra code ;-)

Will wait! Also i want ability to manage thumbnails’ sizes and create them for selected images, not only by one…


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

#440 2009-03-31 09:36:24

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

Re: smd_gallery: super-flexible gallery generator

Hi again,
There is a big problem with the slideshow! instead of showing the article_images of the post I am looking at, it makes a slideshow of every single image in article_image of any article published!

-regarding the “excluding the first image” its because in the list of articles, I display the first article image (small image) next to the Excerpt. If you click on it you get the full article with the slideshow. I guess I could make a custome field for that image (I will try to figure that out)

Any clues on the article image slideshow problem?
Thanks!

Offline

#441 2009-03-31 09:59:11

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

Re: smd_gallery: super-flexible gallery generator

mlarino – you should post your smd_gallery’s code which causes error


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

#442 2009-03-31 10:03:35

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

Re: smd_gallery: super-flexible gallery generator

This is my Gallery Form:

<div id="my_show" class="slideshow">
  <a href="{imagedef#1}"><img src="{imagepath#1}{imagedef#1}" alt="{alt#1}" /></a>
</div>
<script type="text/javascript">
  var data = [{imagedef}];
  var myShow = new Slideshow.KenBurns('my_show', data, {controller: true, hu: '{imagepath#1}'});
  myShow.start();
</script>

This is my Page:

<txp:output_form form="doctype"/>
<txp:output_form form="head_anuncio"/>
<body id="home">
<h1><txp:title /></h1>
<txp:smd_gallery id="?article_image form="gallery" collate="quote:{imagedef}" />
<txp:body />
</body>
</html>

Last edited by mlarino (2009-03-31 10:05:39)

Offline

#443 2009-03-31 10:12:43

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

Re: smd_gallery: super-flexible gallery generator

You missed quote in id attr
Your code: <txp:smd_gallery id="?article_image form="gallery" collate="quote:{imagedef}" />
Should be <txp:smd_gallery id="?article_image" form="gallery" collate="quote:{imagedef}" />


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

#444 2009-03-31 10:38:02

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

Re: smd_gallery: super-flexible gallery generator

Wierd!
my code works without the “
but when I ad the “ you say is missing (and I also think it was missing) it stops working…

and nothing is redered in the html

HTML without (") in tag:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="" lang="">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://www.xxxxx.es/slideshow2/js/mootools.js"></script>
<script type="text/javascript" src="http://www.xxxxx.es/slideshow2/js/slideshow.js"></script>
<script type="text/javascript" src="http://www.xxxxx.es/slideshow2/js/slideshow.kenburns.js"></script>
<link rel="stylesheet" type="text/css" href="http://www.xxxxx.es/slideshow2/css/slideshow.css" />
<script type="text/javascript" src="http://www.xxxxx.es/index.php?js=upm_image"></script>
</head>
<body id="home">
<h1>Espacio 33</h1>
<div id="my_show" class="slideshow">
  <a href="2.jpg"><img src="http://www.xxxxx.es/images/2.jpg" alt="" /></a>
</div>
<script type="text/javascript">
  var data = ["2.jpg","13.jpg","14.jpg","15.jpg"];
  var myShow = new Slideshow.KenBurns('my_show', data, {controller: true, hu: 'http://www.xxxxx.es/images/'});
  myShow.start();
</script>
<p><strong>Direcci&oacute;n: </strong>Paseo de la Castellana, 250 (Torre Espacio, piso 33)<br /> <strong>Localidad: </strong>Madrid<br />     	<strong>Tel&eacute;fono: </strong>91 427 68 91<br /> <strong>Metro: </strong>Bego&ntilde;a<br /> <strong>Tipo de Cocina: </strong>De Mercado<br /> <strong>Especialidad: </strong>Langostinos de Sanl&uacute;car a la sal y carrillera de ternera en fricand&oacute; de zanahorias<br /> <strong>Precio: </strong>de 50 a 75 euros<br /> <strong>Fumadores: </strong>No<br /> <strong>Aparcacoches: </strong>No</p><p>Refero autem ut suscipit luptatum vero molior odio, ut, opto similis ex aptent enim. Vulpes abigo, ideo indoles eligo sagaciter iriure. Nostrud indoles humo consequat odio consequat caecus. Abdo sudo oppeto fere eu multo duis ad. Neo huic autem, si os, opto magna ratis, haero velit vicis autem dignissim venio. Ex, proprius facilisi praemitto wisi delenit enim in feugiat ille. Lenis euismod defui utinam amet aliquip valetudo. Nisl dolus lenis tum decet suscipere. <br /><br />Nulla quidem paulatim pala, gilvus exerci vel lobortis olim comis. Sit, roto, ut oppeto eros foras zelus singularis, ullamcorper vicis premo comis. Nostrud sino feugiat ludus letatio natu duis adipiscing sit tamen. <br /><br />Ea nostrud esse tation secundum autem olim iustum lobortis suscipit, melior lobortis erat. Populus exerci vulputate interdico ex ut ymo pagus, transverbero vel suscipere, ad pala illum jumentum. Ea macto paulatim nostrud distineo epulae, consequat illum letalis. Iusto refero ille caecus, tincidunt typicus erat nimis occuro illum.</p>
</body>
</html>

HTML with (") in tag:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="" lang="">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://www.xxxxx.es/slideshow2/js/mootools.js"></script>
<script type="text/javascript" src="http://www.xxxxx.es/slideshow2/js/slideshow.js"></script>
<script type="text/javascript" src="http://www.xxxxx.es/slideshow2/js/slideshow.kenburns.js"></script>
<link rel="stylesheet" type="text/css" href="http://www.xxxxx.es/slideshow2/css/slideshow.css" />
<script type="text/javascript" src="http://www.xxxxx.es/index.php?js=upm_image"></script>
</head>
<body id="home">
<h1>Espacio 33</h1>
<p><strong>Direcci&oacute;n: </strong>Paseo de la Castellana, 250 (Torre Espacio, piso 33)<br /> <strong>Localidad: </strong>Madrid<br />     	<strong>Tel&eacute;fono: </strong>91 427 68 91<br /> <strong>Metro: </strong>Bego&ntilde;a<br /> <strong>Tipo de Cocina: </strong>De Mercado<br /> <strong>Especialidad: </strong>Langostinos de Sanl&uacute;car a la sal y carrillera de ternera en fricand&oacute; de zanahorias<br /> <strong>Precio: </strong>de 50 a 75 euros<br /> <strong>Fumadores: </strong>No<br /> <strong>Aparcacoches: </strong>No</p><p>Refero autem ut suscipit luptatum vero molior odio, ut, opto similis ex aptent enim. Vulpes abigo, ideo indoles eligo sagaciter iriure. Nostrud indoles humo consequat odio consequat caecus. Abdo sudo oppeto fere eu multo duis ad. Neo huic autem, si os, opto magna ratis, haero velit vicis autem dignissim venio. Ex, proprius facilisi praemitto wisi delenit enim in feugiat ille. Lenis euismod defui utinam amet aliquip valetudo. Nisl dolus lenis tum decet suscipere. <br /><br />Nulla quidem paulatim pala, gilvus exerci vel lobortis olim comis. Sit, roto, ut oppeto eros foras zelus singularis, ullamcorper vicis premo comis. Nostrud sino feugiat ludus letatio natu duis adipiscing sit tamen. <br /><br />Ea nostrud esse tation secundum autem olim iustum lobortis suscipit, melior lobortis erat. Populus exerci vulputate interdico ex ut ymo pagus, transverbero vel suscipere, ad pala illum jumentum. Ea macto paulatim nostrud distineo epulae, consequat illum letalis. Iusto refero ille caecus, tincidunt typicus erat nimis occuro illum.</p>
</body>
</html>

I am confused…

Last edited by mlarino (2009-03-31 10:45:20)

Offline

#445 2009-03-31 12:02:29

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

Re: smd_gallery: super-flexible gallery generator

The plugin is getting all the images from the images folder, instead of only the images from the article_image field…
I studied the plugin deeper but cant find any mistake in what I wrote…

Is it posible that this code:

<script type="text/javascript">
myShow1 = new Slideshow("slideshow1",
  { hu: "<txp:site_url />images/",
    images: [{imglist}],
    captions: [{alt}],
    classes: ["prev","next","active"],
    type: "fade"
  });
</script>

is getting all those images from the images folder instead of the ones in article_image?

because this is what I am getting in every single article:

<script type="text/javascript">
  var data = ["2.jpg","13.jpg","14.jpg","15.jpg"];
  var myShow = new Slideshow.KenBurns('my_show', data, {controller: true, hu: 'http://www.xxxxx.es/images/'});
  myShow.start();
</script>

Any ideas?
http://www(dot)cityexpert(dot)es

Last edited by mlarino (2009-03-31 16:42:21)

Offline

#446 2009-04-01 09:37:05

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

Re: smd_gallery: super-flexible gallery generator

<txp:smd_gallery id="?article_image" form="gallery"
  collate="quote:{imagedef}:{alt}" />

Can that code be placed in a form instead of a page?
I am playing around with different options, none seem to work
id=”?article_image” doest do anything.
id=”?article_image (without the closing “) displays every image in the images folder.

Is this a bug with the ID? because I don’t see where I am making a mistake.

Has anyone successfully created a slideshow of article images inside a post?

Each post with its own article images of course.

Thanks!

Last edited by mlarino (2009-04-01 09:38:23)

Offline

#447 2009-04-01 12:15:59

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

Re: smd_gallery: super-flexible gallery generator

mlarino wrote:

HTML without (") in tag:

If this is your HTML without the missing double quote:

<div id="my_show" class="slideshow">
  <a href="2.jpg"><img src="http://www.xxxxx.es/images/2.jpg" alt="" /></a>
</div>
<script type="text/javascript">
  var data = ["2.jpg","13.jpg","14.jpg","15.jpg"];
  var myShow = new Slideshow.KenBurns('my_show', data, {controller: true, hu: 'http://www.xxxxx.es/images/'});
  myShow.start();
</script>

then it probably means you have another missing quote or some unvalidated code elsewhere on the page. Does your page validate? Look at the code in the Firefox View Source tool because that often highlights unterminated characters and stuff it cannot interpret — it shows it up in red text.

Is this a bug with the ID?

Shouldn’t be if you are using the latest versions of smd_lib and smd_gallery. The ID range bug was squashed in v0.35 of smd_lib.

Has anyone successfully created a slideshow of article images inside a post?

Yes, me! I can assure you it works. As long as you have a comma-separated list of IDs in your article image field, your form will output the code necessary to render a slideshow. The code is being output fine on the page (as shown above, you can see it is using images 2, 13, 14, and 15). If you’re not seeing anything when it’s rendered on-screen then that is another issue to do with the sildeshow javascript and not the plugin. The plugin’s job ends when the code is output.


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

#448 2009-04-01 14:22:27

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

Re: smd_gallery: super-flexible gallery generator

Hi Bloke,
Thanks for the reply,
The code the plugin is outputting is correct, and I see the Slideshow, the problem is that it not only outputs the coma separated images from the article field, it just outputs every image in the image/ folder.

I will try to find an error in my code and see if that is the problem.
I am using v0.51 so I guess it should work fine.
I will try and see what the problem is and come back
Thanks again for your help!

Offline

#449 2009-04-01 14:26:01

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

Re: smd_gallery: super-flexible gallery generator

Hi Bloke,
Thanks for the reply,
The code the plugin is outputting is correct, and I see the Slideshow, the problem is that it not only outputs the coma separated images from the article field, it just outputs every image in the image/ folder.

this is and test post with the slideshow:
http://www.cityexpert.es/13

I will try to find an error in my code and see if that is the problem.
I am using v0.51 so I guess it should work fine.
I will try and see what the problem is and come back
Thanks again for your help!

Offline

#450 2009-04-01 14:32:28

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

Re: smd_gallery: super-flexible gallery generator

mlarino wrote:

the problem is that it not only outputs the coma separated images from the article field, it just outputs every image in the image/ folder.

Ok, that’s a different problem. Sorry, I misunderstood. Can you show me where it’s doing this? I’ve looked on the site you posted earlier and if I click on one of the Foto restaurante links, a lightbox pops up with a slideshow of 8 images in it. I can’t see anywhere it is outputting all images in the image folder.


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

Board footer

Powered by FluxBB