Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2008-05-27 12:03:28
- daikw
- Member
- Registered: 2007-10-06
- Posts: 39
Changing layout with smd_gallery
Hi there,
With the assistance of some members on this forum I succeeded in creating this lightbox gallery using smd_gallery and the original lightbox.js script. I now need to change the layout slightly; instead of a lightboxed image appearing over the thumbnails – there needs to be category list on the left “Photography, Face Texts, Figurative, Site Design, Softline Drawing”. And instead of showing all categories, the thumbs in the middle now only need to be of the category that the user has clicked on. Then when a user clicks on a thumb, a full size image of it should appear on the right.
I have input a category list on the left <txp:category_list type="image" />
but these links currently take the user to a separate page for that category – rather than changing the thumbs in the middle– which is what I want.
I have used these forms to create the gallery (thanks Bloke)
gallery_form
<txp:smd_gallery category="figurative, face-texts, softline-drawing, a_photography" form="gallery_layout" thumbchange="category_title" thumbchangewraptag="h2" />
<div class="divider"><img src="<txp:site_url />images/1.gif" width="900" height="1" alt="---" title="" /></div>
gallery_layout
{changed:category_title}
<a rel="lightbox" href="{url}" title="{title}">{object}</a>
Could anyone lend a hand on this?
Thanks, Dai
Last edited by daikw (2008-05-27 12:05:31)
Offline
Re: Changing layout with smd_gallery
daikw wrote:
I have input a category list on the left
<txp:category_list type="image" />
but these links currently take the user to a separate page for that category
Hmmm, yes they will because as far as I know <txp:category_list />
links to article categories, despite what you can do with the type
attribute (is this an oversight in category_list? I’ve never used it). I believe the ?c=category_name
is only for articles, which is why you get nothing back on those pages.
To display one image category only at a time you could perhaps get smd_gallery to put them all on the screen at once then try a javascript (jQuery?) accordion or similar trickery to hide all but one.
Get smd_gallery to output each category in its own div block (you could generate a unique ID if necessary using <div id="block{counter}">
) and use the accordion to show/hide them when the category names are clicked. It’d probably need some more thought if you wanted to go this route, but if nobody else chimes in with a better solution we can probably work something out along these lines.
Last edited by Bloke (2008-05-27 12:27:28)
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