Textpattern CMS support forum

You are not logged in. Register | Login | Help

#631 2010-01-06 06:45:32

idesign123
Member
Registered: 2009-12-06
Posts: 13

Re: smd_gallery: super-flexible gallery generator

Oops, sorry.

That one has…
<a href="{url}" title="{title}" class="thumb" ><img src="{thumburl}" alt="{alt}" /></a> <div class="caption"> <div class="image-title">{alt}</div> </div> <txp:hide> <li><a href="<txp:upm_img_full_url />" title="<txp:upm_img_caption />" class="thumb" ><img src="<txp:upm_img_thumb_url />" alt="<txp:upm_img_alt />" /></a> <div class="caption"> <div class="image-title"><txp:upm_img_alt /> </div> <txp:if_upm_img_caption><div><txp:upm_img_caption /></div></txp:if_upm_img_caption> </div> </li> </txp:hide>

I’m actually not sure it’s needed anymore now that I’ve switched to smd_gallery. But I left it in just in case.

Offline

#632 2010-01-07 04:11:45

idesign123
Member
Registered: 2009-12-06
Posts: 13

Re: smd_gallery: super-flexible gallery generator

Any ideas? It appears Stef is on vacation – does anyone else know how to make my captions visible?

Offline

#633 2010-01-07 12:01:23

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,315
Website

Re: smd_gallery: super-flexible gallery generator

idesign123 wrote:

It appears Stef is on vacation

Vacation, my eye! Cheeky sod :-)

I’ve never used Gallerific but a quick look through the usage docs leads me to believe you need to put your image captions inside <div class="caption">caption in here</div>.

You appear to be putting <div class="caption"><div class="image-title">alt text is here</div></div> which means your caption is your alt text (and it looks like it’s empty). If you want to show the caption, you should use {caption} or {title} in your form.

Last edited by Bloke (2010-01-07 12:03:13)


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

#634 2010-01-08 05:22:39

idesign123
Member
Registered: 2009-12-06
Posts: 13

Re: smd_gallery: super-flexible gallery generator

Wow, I’ve never been called a “cheeky sod” before! I admit I had to look it up (since our England friends speak an unusual variation of the true “English” language, spoken in America ). Just kidding!!!

Oops – I hope you’ll still help me after that one…

I’m obviously not understanding something very basic in how Textpattern works. As a test, I tried adding a caption to a totally new page. No “Galleriffic” code or anything else unusual. I tried adding the caption three different ways, and none of the tests worked.

Here’s the code on the test page…

<txp:article_image /> <br /><br />
Caption Attempt #1 - {caption} {title} <br /><br />
Caption Attempt #2 - <txp:caption /> <txp:title /> <br /><br />
Caption Attempt #3 - <txp:article form="test" />

The third attempt references a form with the following code..

{caption} <txp:caption /> {title} <txp:title />

The resulting page can be viewed at http://www.jwdlicensing.com/index.php?id=40

If I look in the source code, I do see that the caption text (“This image is available for sale”) is showing up in the “title” tag, but this caption text is not visible on the page itself.

Adding the “title” variation of the code does nothing on the first attempt. In the second & third attempt, it shows the word “test”, which is the page title, but not the caption text.

Do you see what I’m doing wrong?

Last edited by idesign123 (2010-01-08 05:37:31)

Offline

#635 2010-01-08 09:45:19

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,315
Website

Re: smd_gallery: super-flexible gallery generator

idesign123 wrote:

I’m obviously not understanding something very basic in how Textpattern works.

OK, no worries. It’s partly due to the syntax that smd_gallery employs. It’s not very “TXPish”. Here goes, step by step (hope it’s not too patronising!) :

  1. Edit your test article and make sure there is a valid image category name in your article_image field. This will be the category containing the images you want to display on that page
  2. Go to your Images tab and make sure you have some images assigned to that category
  3. In each image, check its Alternate Text and Caption fields have something in them. The alternate text will become the <img> tag’s alt attribute and Caption will be what you want to see under the picture
  4. Assuming the code in your gallery page/form is the same as you first posted above, put <a href="{url}" title="{title}" class="thumb" ><img src="{thumburl}" alt="{alt}" /></a> <div class="caption">{caption}</div> in your article_image_form

({title} and {caption} are synonymous)

Your smd_gallery tag calls the article_image_form for each image in your chosen category so it will render:

<a href="http://site.com/images/N.jpg" title="The caption here" class="thumb" >
   <img src="http://site.com/images/Nt.jpg" alt="The alt here" />
</a>
<div class="caption">The caption here</div>

for every image. Hopefully, gallerific will know what to do with that markup and make your slideshow accordingly. If not, alter the markup so it understands :-)

The {replacement} syntax is a feature of the smd_gallery plugin so it cannot be used outside the smd_gallery tag’s container or nominated Form. That’s why you can’t see it on your test page. Sadly (at the moment) Textpattern does not have a native tag for outputting the image caption — which is why you were using upm_image before, because it does have tags for doing that.

Has that demystified it a bit? Shout back if you’re still confused.

Last edited by Bloke (2010-01-08 09:47:11)


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

#636 2010-01-15 04:43:57

speeke
Member
From: Bruny Island, Australia
Registered: 2009-03-29
Posts: 161
Website

Re: smd_gallery: super-flexible gallery generator

Hiya Stef,

I know, I know – I’m popping up all over the place, but your plugins are just soooo good …

I posted a query in “How Do I…? & Other Questions” recently, without reply. I thought I’d flag it here because there may be others, who are using smd_gallery (and smd_bio), who have an elegant solution.

Much appreciated.


“People who value their privileges above their principles soon lose both.”
Dwight D. Eisenhower

Offline

#637 2010-01-16 01:18:18

idesign123
Member
Registered: 2009-12-06
Posts: 13

Re: smd_gallery: super-flexible gallery generator

Stef – Thanks so much for the “caption” code!!! It worked perfectly :-)

Last edited by idesign123 (2010-01-16 01:18:37)

Offline

#638 2010-01-22 12:24:04

-P-
Member
From: Finland
Registered: 2005-09-10
Posts: 211

Re: smd_gallery: super-flexible gallery generator

Hello! Firstly, thank you for a great plugin. Assumably all went good but on cross browser testing it seems like gallery does not work with IE7 and prior versions.

I am quite (very) n00b with javascript so maybe I just messed up?
Sorry if my code looks horrible, I basicly just gathered and copypasted stuff I found from this thread

It’s supposed to be Slideshow2 gallery with non linking images, no controls or captions, just thumbnails and gallery image. Seems to work on everything else than on IE…

article form
<txp:smd_gallery form="gallery" category="first" collate="quote:{imagedef}" sort="id" order="asc"/>

gallery form

<div id="photos" class="gallery">
<img src="{imagepath#1}{imagedef#1}" alt="{alt#1}" />
</div>
<script type="text/javascript">
  var data = [{imagedef}];
  var myShow = new Slideshow('photos', data, {controller: false, hu: '{imagepath#1}', linked: false});
</script>

Atm even quick and dirty solution will do, I just need to get this up and running also with IE.
But am also open to other gallery options with smd_gallery, as long as they give same slideshowish effect and are preferably as light as possible.

Last edited by -P- (2010-01-22 12:25:34)

Offline

#639 2010-01-31 17:36:26

THE BLUE DRAGON
Member
From: Israel
Registered: 2007-11-16
Posts: 558
Website

Re: smd_gallery: super-flexible gallery generator

For some reason the paging is not working for me.
It was working fine in the past with an older version of the plugin and on txp 4.0.8
but now it just not paging o_O
I run it on TXP 4.2 with plugin ver 0.53 + lib ver 0.36

I do get the paging links and after I click on them it does changing the url,
but the images are staying as the first page images.
and the current page link ({navthisurl}) is staying on “1” even that the url is now on page #4

This is my gallery form:

<txp:smd_gallery category="?Photos Category" pageform="photos_paging" pagepos="above,below" navwraptag="div" navclass="photos_paging" navbreak="div" limit="150">
<a href="{url}" rel="photos<txp:article_id />" title="<txp:custom_field name="Photos Gallery Title" />" class="photo" onfocus="if(this.blur)this.blur()"><img src="{thumburl}" border="0" alt="" /></a>
</txp:smd_gallery>

This is my paging form:

{navfirst}{navprev}{navearlier}{navthis}{navlater}{navnext}{navlast} <div>Displaying {totalimages} of {maximages} photos.</div>

What am I missing here please?

Offline

#640 2010-02-01 10:58:56

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,315
Website

Re: smd_gallery: super-flexible gallery generator

THE BLUE DRAGON wrote:

What am I missing here please?

Nothing as far as I can tell, it works fine for me. We might need to do some diagnostic tomfoolery here to figure out what’s going on. First, a few checks:

  • Are you generating the gallery from an individual article context? It needs to be that way so it can read the custom fields you are using
  • When you click on the next page, does the URL stay the same apart from the ‘X’ in the ?smd_glry_nnnn=X part? If not, I suspect it’s because it’s falling back to an article list view and is thus “losing” the custom field containing the gallery attributes
  • What does the plugin set ?smd_glry_* to? Using your code, I see smd_glry_984f (yours will be different because the category names are different for you). Does that value prevail in the URL when you navigate between pages or does it change? If it changes, that’s the problem and we need to figure out why
  • 150 images per page! Wow… does it make any difference if you reduce this, just to test it out?

If none of that helps, try adding debug="1" to the tag and let’s see if we can figure out why things are breaking by looking at the SQL.

Incidentally, one of the things I was missing was a bug in v0.53 (and, in fact every version prior to this). The short version of proceedings is that I was (stupidly) not limiting the category name to image categories. Thus, if you had an image category called “cat1” with a title “First image cat” and created a file category called “cat1” with a title “First file cat”, smd_gallery would duplicate each image — since the two categories differ only by title, my brain-damaged SQL statement included them both.

This is now fixed in v0.54. I suspect this contributed to the problems that maniqui, cuda and visualpeople had with duplicated images. Sorry it took me so long to figure this out guys.


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

Board footer

Powered by FluxBB