Content last modified Friday 29 August 2014
hop to #bottom
Categories:
Author:
About It:
Rate it:
  • Helpful?
  • 0 Yes
  • 0 No
Flag it:
Contact Reason [ ? ]

Setting up a (thumbnail-) gallery

This tutorial is based on the German tutorial:
“Eine (Thumbnail-) Galerie umsetzen” by Nils and Alex.
It referrs to a thumbnail-gallery Nils H. did set up on the german site www.durchgedreht24.de.

The gallery consist of an gallery overview page, introducing the single galleries and the assigned single galleries pages.

Example gallery overview page:
durchgedreht24.de/galerie/

Example single gallery:
durchgedreht24.de/galerie/preisverleihung

HOW TO

1. The Plugin

The only external ingredient needed is the rss_thumbpop plugin.

2. The Basic Structure

The rss_thumbpop plugin can connect article and images to a gallery automatically when the images are categorized using a specific scheme. The structure of the gallery is very simple: every gallery is an article of its own and a gallery overview is created by means of an ordinary article list.

3. The Sections, Pages, and Forms

First set up a section called e.g. “gallery” and assign a
X/HTML page to it. This will be the gallery overview page. Style the page as you like it. To list single galleries on this overview page, we use conditional comments.

Place the following lines into that page:
<txp:if_article_list> <txp:article_custom form="gallery-list" category="yourCategory1" section="gallery" /> <txp:article_custom form="gallery-list" category="yourCategory2" section="gallery" /> </txp:if_article_list>
<txp:if_individual_article> <txp:article form="gallery-single" /> </txp:if_individual_article>

As you can see, two forms are needed:

The form “gallery-list” contains the following:
<txp:permlink><txp:article_image /></txp:permlink> <txp:permlink><txp:category1 /><txp:title /></txp:permlink> <txp:excerpt /> <txp:posted /><txp:glx_image_count />images</div>

The form “gallery-single” contains:
<txp:title /> <txp:posted /> <txp:rss_thumbpop jpop="1" articlethumbs="1" clickonly="1" fullontop="0" mode="float" cols="x" showcaption="0"/>

(showcaption=“0” can be 1 if you like to add the images caption.)

Create those forms under presentation ->forms and save those as article forms.

4. The Gallery

Now publish an article with the title you want to use, e.g. “My 1st Gallery” and assign the article to the “gallery” section. The title of this article will be the name of the gallery. Next, find the
article ID by hovering over the articles titel under:
content->article.
The ID can be found in the tooltip which pops out as well as at the bottom of your browser while you hover over the title.
Keep the ID in mind for the next step.

5. The Images

Set up an image category and name it using the format article-ID: “article-” plus assigned ID (for example “article-123”). Upload your images and thumbnails. Save them under the corresponding category (like “article-123”).

If you’ve got a lot of images to upload, you can use the nhn_image_import plugin. WIN NT users can use Sencers asy_xpwizard plugin.
Additionally you can get the glx_admin_image_resize Plugin which is very helpful for creating thumbnails. Since RC5 is out, TXP comes with a build-in thumbnail generator.
To let users know how many images are in a gallery, use the glx_image_count plugin.

6. Finished
Feel pleased if you made it this far.
Style your gallery as you like.

Note:
CSS styles have been removed from the code.
By applying article categories, you can add further structure (like in the example) for months or years.
Thanks to Lee for editing the text.

Article Request Count:

Archived [?]: broken links

Keywords/tags:
Initially released:
July 05
Posted here:
02 Aug 2005
Article modified:
12 Jun 2008

Comments/questions? Leave a message in the form.

Commenting is closed for this article.

Commented (21)

henry:
Could you give us a little more info on how we customize the ‘gallery’ page to include the different galleries? For instance, what should one use to replace the part saying ‘yourCategory1’? I didn’t create a seperate category, only a seperate section as per the instructions.
I know see a plain blank page with mu header and footer when I access ‘gallery’. no picture or text.

Thanks,
Henry.
Nils Hörrmann:
Just use < txp:article_custom form="gallery-list" section="gallery" /> instead (without the starting whitespace), that should help. Have you assigned the right page template to the section and have you assigned the right section to the gallery articles?
I’m trying to set this up and I get these errors on the gallery page:

Notice: Undefined variable: artcat in textpattern/lib/txplib_misc.php(429) : eval()’d code on line 95

Notice: Undefined variable: divimg in textpattern/lib/txplib_misc.php(429) : eval()’d code on line 139

Notice: Undefined variable: i in textpattern/lib/txplib_misc.php(429) : eval()’d code on line 184

How can I fix this?
alex:
Hi Josh,
please post your question in the txp forum as this is an txp issue rather than a gallery one.
Lee:
Thanks for a really useful tutorial.
Very nice write up Alex & Nils. And your example looks great.
I can’t get this puppy working for me. It may have something to do with misunderstanding how to customize it for the sections I already have, and how to customize the categories?

See this thread http://forum.textpattern.com/viewtopic.php?pid=71907#p71907 for the details.

Thanks for your help,

Matthew
Ji31:
Does it work also on rc4?
I have just white space in my code and I have checked it alrealy 1000x.
june:
How did you get to work?

The rest of my gallery is functional. My image count displays 0 images even though each gallery has images.

thanks.

june
Derrick:
As far as I can tell after looking this over several times, I think I set it up correctly, but when the page loads I get a “no images found” error. Did I skip a step.. someone help me out.

The category is called India-35. The article ID is 35, and the images are linked to that category. What’s missing here?
gary:
Sorry, this tutorial doesn’t make any senses to me.
“no images found”?
Then your image category is not “article-”.
It has always to be “article-id”!
The “example” and “here” refers only to the id.
I had problem with setting up, it is too complicated for me.
Great tutorial – thanks so much! Everything is working perfectly. :)
patchwork:
great tutorial!! overall.
I think it manages to gets us on the right track, but it could be more precise and documented.
btw, you are missing a start div tag in the gallery-list code.
at the time we can just use a category name like “article-id”.

some idea about how to allow different names, like words or terms, as apache works in mod_rewrite?

thanks
f
markus haist:
Great article – works like a charm

/m
Thanks!
easy, usefull, respect!
Thanks for a really useful tutorial.
D Colburn:

Links are dead

Subscribe to this article's comments RSS feed. [ ? ]   View Recent Comments across the site.

Would you care to write a comment?

You know you want to visit the Archives.

Browse

Categories


Articles

There are also tag clouds, 'cause those are fun.