Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Weblog & a small image gallery?
Using Txp to write a weblog article about a field trip, vacation or other event would be enhanced if there’s an easy way to add a brief (5 to 20) photo gallery with captions. Notice how the photo album in the upper right corner of this site behaves.
- What plugin, tags or features within Txp can be used to make such a gallery launch/pop up from either a link or a thumbnail in an article as it does in the example site?
- Is there a way within the plugin or tag to control the size of the new window that pops up?
- Does the same plugin or tag also permit the captioning as well as the “previous-next” navigation?
Just to clarify, the entire weblog/site is NOT a photo site. This is merely one example of how an article with a short photo album might be more interesting.
Thanks for any pointers anyone can provide. (slowly, I’m diving back into Txp, but I want to apply some things fairly soon)
“Well, I, uh, don’t think it’s quite fair to condemn a whole program because of a single slip-up, sir.” General ‘Buck’ Turgidson
Offline
Re: Weblog & a small image gallery?
6sigma
You can probably use upm_image or rss_thumbpop for this pretty easily.
From my own arsenal of plugins I would of course recommend smd_gallery if you don’t mind getting your hands dirty in its taginess. Set the article_image field of an article to the name of an image category and then use smd_gallery to grab all the images from that category. You can use the thumblimit="1"
attribute to only show one thumbnail.
You can use javascript/jQuery to pop up the window (yes I believe you can control its size from jQuery) which will open the URL to a special section site.com/gallery?cat=name-of-category
. In your gallery
Page template you can put the bare bones html/head/body tags and an smd_gallery tag that grabs that cat variable and starts a gallery off. Using limit=1
and the built-in paging features of smd_gallery you can easily create a next/prev system. You gallery tag could be something like this (untested) :
<txp:smd_gallery category="?cat" limit="1" paging="1">
<txp:image id="{id}" />
<span class="caption">{caption}</a>
<ul class="nav">
{navprev} <li><a href="#" onclick="window.close()">Close</a></li> {navnext}
</ul>
</txp:smd_gallery>
Hope that gives you some ideas.
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
Re: Weblog & a small image gallery?
Thanks, Stef. Your response points to the kinds of things I need to learn as I get back into Txp.
This keeps me from thrashing around in the weeds. Very useful.
“Well, I, uh, don’t think it’s quite fair to condemn a whole program because of a single slip-up, sir.” General ‘Buck’ Turgidson
Offline
Pages: 1