Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-03-10 17:13:03

jmart
Member
Registered: 2008-08-25
Posts: 68

Creating a photo gallery using smd plugins

I can’t seem to get my photo gallery to display the pictures properly on this site: http://www.roofingbyelite.com/projects/gallery

I have this working on a previous site so I can’t undererstand what is happening; http://www.fitnessforgenerations.com/gallery

I’m hoping someone could point out what I did wrong. I have to believe it’s something so minor that I’m overlooking it

I have the following plugins installed: smd_gallery, smd_if, smd_lib, jmd_img_selector

the page template has this

 <txp:if_article_list>
      <txp:article_custom section="gallery" form="gallery" sort="posted asc" limit="9999" />          
         <txp:else />         
    </txp:if_article_list>

Form looks like this;

<txp:smd_gallery id="?article_image" sort="fixed">

<div class="gallery">
  <txp:smd_if field="{counter}" operator="eq" value="1">
  <div class="main-image">
    <a href="{url}" rel="lightbox-gallery-<txp:article_id />" title="{caption}">
    <txp:thumbnail id="{id}" />
    <small><txp:title /></small>
    </a>
  </div>

  <txp:else />

  <div class="extra-images">
    <a href="{url}" rel="lightbox-gallery-<txp:article_id />" title="{caption}">Gallery "<txp:title />" - Image ({counter})
    </a>
  </div>
  </txp:smd_if>
</div>
</txp:smd_gallery>

Last edited by jmart (2010-03-10 17:33:47)

Offline

#2 2010-03-10 18:23:57

JanDW
Plugin Author
From: Providence, RI, USA
Registered: 2008-07-18
Posts: 327
Website

Re: Creating a photo gallery using smd plugins

looking at the tag trace: You’re not in an article list context:

<txp:if_article_list>
	[<txp:if_article_list>: false]
</txp:if_article_list>

edit: so you should call the article tag before you call <txp:if_article_list>

Last edited by JanDW (2010-03-10 18:31:11)


TXPDream – A Textpattern Tag Library for Adobe Dreamweaver. (updated for 4.2.0) | jdw_if_ajax – Only serve certain parts of a page when requested with AJAX

Offline

#3 2010-03-10 19:09:54

jmart
Member
Registered: 2008-08-25
Posts: 68

Re: Creating a photo gallery using smd plugins

That’s not the issue considering I’m using the same code for the other site that does work.

I also just took out the tags altogether and have the following but nothing still shows up;

  <txp:article_custom section="gallery" form="gallery" sort="posted asc" limit="9999" />

Offline

#4 2010-03-10 19:23:35

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

Re: Creating a photo gallery using smd plugins

JanDW is onto something. The tag trace shows no calls to smd_gallery so your gallery form is not being processed at all.

First assertion: how many articles are in your section called gallery? That’s the number of times the gallery form will be called. Currently it’s being called zero times.

Second assertion: the URL you supplied http://www.roofingbyelite.com/projects/gallery is of the form site/section/article. Therefore JanDW is correct that if_article_list will not be called because that page is an individual article and not a list.

Last edited by Bloke (2010-03-10 19:24:18)


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

#5 2010-03-10 19:40:46

jmart
Member
Registered: 2008-08-25
Posts: 68

Re: Creating a photo gallery using smd plugins

There is only 1 article in the section, Projects. And that would be www.roofingbyelite.com/projects/gallery . Having realized that, the photos should be appearing in the url; www.roofingbyelite.com/projects because this is in an article list context. My bad. So this should still be working just like the other site. I just gave the wrong url, that’s all.

Offline

#6 2010-03-10 19:46:19

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

Re: Creating a photo gallery using smd plugins

jmart wrote:

There is only 1 article in the section, Projects.

I’m officially confused :-s

I asked how many articles are in the section called gallery because that’s the section you’re asking <txp:article_custom /> to look in. I just tried to visit http://www.roofingbyelite.com/gallery and got a 404 which implies there’s no section called gallery and therefore the article_custom tag is, in fact, doing its job properly; i.e. calling the gallery Form for each article from a section that doesn’t exist!

Last edited by Bloke (2010-03-10 19:48:07)


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

#7 2010-03-10 20:11:52

jmart
Member
Registered: 2008-08-25
Posts: 68

Re: Creating a photo gallery using smd plugins

Doh. I see what you mean. That is an oversight on my part. Apologies.

The article custom tag was calling the section, gallery, when there was none. I had the section named as “projects”. I’ve since fixed this and renamed the section to gallery so the new url is www.roofingbyelite.com/gallery Everything else remains the same, but still no go.

Offline

#8 2010-03-10 20:19:44

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

Re: Creating a photo gallery using smd plugins

jmart wrote:

Everything else remains the same, but still no go.

OK, now we’re getting somewhere! So it looks like the plugin is choking on the sort="fixed". Can you put debug=“1” or debug=“2” on in your smd_gallery tag and leave it on for a bit so I can take a look at your page and see if I can figure out why it thinks there are no images in your article_image fields. Thanks.

Last edited by Bloke (2010-03-10 20:20:50)


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

#9 2010-03-10 20:27:20

jmart
Member
Registered: 2008-08-25
Posts: 68

Re: Creating a photo gallery using smd plugins

where in the plugin do I go to input debug=“1” ?

like this? <txp:smd_gallery id=”?article_image” sort=“fixed” debug=“1”>

Last edited by jmart (2010-03-10 20:29:34)

Offline

#10 2010-03-10 20:29:51

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

Re: Creating a photo gallery using smd plugins

Thanks, I saw some debug output for a moment there. It looks like the plugin is looking for images 4, 5, 6 and 3 in that order. I assume those image IDs exist and contain valid images? (gotta check all bases here when things like this go sideways!)

(add debug=“2” to the smd_gallery tag itself in your gallery form)

EDIT: and are those images assigned to a category?

Last edited by Bloke (2010-03-10 20:34:35)


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

#11 2010-03-10 20:41:59

jmart
Member
Registered: 2008-08-25
Posts: 68

Re: Creating a photo gallery using smd plugins

Yep- the images are definitely there. But they aren’t assigned a category.

I added debug=“2”

Offline

#12 2010-03-10 20:42:04

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

Re: Creating a photo gallery using smd plugins

jmart wrote:

like this? <txp:smd_gallery id=”?article_image” sort=“fixed” debug=“1”>

Yup, perfect.

If those four images I mentioned all exist on your Images tab and they’re not categorised then I have a suspicion I know what the problem is — it’s something I kinda knew would come back and bite me one day, but just hoped nobody would find :-)


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