Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#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: 11,448
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.

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: 11,448
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.

Txp Builders – finely-crafted code, design and Txp

Offline

#451 2009-04-01 14:39:25

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

Re: smd_gallery: super-flexible gallery generator

Ok, this post has only image 2,13 in the article_image field.
http://www.cityexpert.es/13/hola-tania

but as you can see in the source, its outputting 17,2,13,14,15,19,18,16 (all images in the images folder)

var data = ["17.jpg","2.jpg","13.jpg","14.jpg","15.jpg","19.jpg","18.jpg","16.jpg"];
  var myShow = new Slideshow.KenBurns('my_show', data, {controller: true, hu: 'http://www.cityexpert.es/images/'});
  myShow.start();

Last edited by mlarino (2009-04-01 14:42:33)

Offline

#452 2009-04-01 14:57:29

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

Re: smd_gallery: super-flexible gallery generator

mlarino wrote:

this post has only image 2,13 in the article_image field.

Baffling. I’ve just put this in my article form (right before <txp:body />):

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

and this in 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>

And when I put 2,13 in my Article Image field I see:

var data = ["2.jpg","13.jpg"];

in the HTML source. Clearly something is not working in your case, but I cannot figure out what it is because your exact code works on my test server! :-s

You do have smd_lib v0.35 installed, yes?


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

#453 2009-04-01 15:06:13

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

Re: smd_gallery: super-flexible gallery generator

Yes, Smd_lib v0.35 is installed
Also ump_image, could that be causing some errors?

I will make a fresh install and see whats wrong, cant find mistakes in the code at all…
I will post if I see something
Thanks a lot for your help Bloke! I hope I can figure this out fast!

Offline

#454 2009-04-01 16:54:41

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

Re: smd_gallery: super-flexible gallery generator

Is there a minimum requirement of textpattern version?
I am using 4.0.6

Offline

#455 2009-04-01 17:05:58

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

Re: smd_gallery: super-flexible gallery generator

mlarino wrote:

Is there a minimum requirement of textpattern version?

I don’t think so, but I’ve not tried v0.5 in anything less than 4.0.7. I would think you’d see more actual errors than just a functional one if it was not working (assuming your site is in debugging mode?) But you should definitely upgrade anyway.

BTW, what happens if you add debug="2" to the smd_gallery tag? Can you let me know what you see under ++ INCLUDED/EXCLUDED IDs AND CATs ++ and ++ WHERE CLAUSE ++ for the article you mentioned above please?


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

#456 2009-04-01 18:47:30

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

Re: smd_gallery: super-flexible gallery generator

This is what I get with both (“”)

++ INCLUDED/EXCLUDED IDs AND CATs ++
array (
  0 => '\'?article_image\'',
)
++ WHERE CLAUSE ++
(1=1 AND  (txp_image.id IN ('?article_image')) ) ORDER BY txp_image.id asc
SELECT DISTINCT
txp_image.name,txp_image.id,txp_image.alt,txp_image.caption,txp_image.category,txp_image.author,txp_image.date,txp_image.ext,txp_image.w,txp_image.h,txp_image.thumbnail, txp_category.title AS category_title
			FROM txp_image LEFT JOIN txp_category
			ON txp_image.category = txp_category.name
			WHERE (1=1 AND  (txp_image.id IN ('?article_image')) ) ORDER BY txp_image.id asc
			LIMIT 0, 99999

This is without the closing (“)

++ INCLUDED/EXCLUDED IDs AND CATs ++++ WHERE CLAUSE ++
(1=1) ORDER BY txp_image.category asc
SELECT DISTINCT txp_image.name,txp_image.id,txp_image.alt,txp_image.caption,txp_image.category,txp_image.author,txp_image.date,txp_image.ext,txp_image.w,txp_image.h,txp_image.thumbnail, txp_category.title AS category_title
			FROM txp_image LEFT JOIN txp_category
			ON txp_image.category = txp_category.name
			WHERE (1=1) ORDER BY txp_image.category asc
			LIMIT 0, 99999

I wish I could update to the latest textpattern but I am using a plugin I really need that only works in version 6, and not in 7 or 8 :(

Last edited by mlarino (2009-04-01 18:48:33)

Offline

Board footer

Powered by FluxBB