Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-11-25 15:45:19

Plugin Author
Registered: 2005-03-12
Posts: 1,253

[howto] Gallery Archive template without plugins

During my attempt to prototype a simple barebone Template for a Gallery archive I ran into a couple of problems implementing such a thing based on the tutorials that try to use various plugins to achieve the desired results.

Why not solely relying on TXP’s corefeatures? (v4.0.2)
I wanted to have a simple solution without having to rely on complex plugins and the Idea of workflow automization in mind.
The Shortcoming of course is the URL handling due to the nature of categories in Textpattern.

I use glx_admin_image and nhn_image_import to automate image upload though.
Furthermore, allthough not wanting to depend on plugins I use the very simple wet_article_thumb which makes it more easy.

The method is based on Zem’s explanation on how to implement a simple gallery as described here

In order to implement this we rely on the txp:image_display and txp:image_index tags. The major difference here is, that we use articles and cusom fields to automate for multiple gallery entries under the gallery section which is allso convenient for archieving your personal picture galleries.

I summarize the necessary steps below:

  1. Create as many image categories you need, e.g.: firstgallery,secondgallery,etc.(Create article-category siblings ,if you like to customize as desc. in step 6)
  2. Install necessary plugins,activate, upload images, create thumbnails and assign each image to it’s gallery category.(Basically each category and gallery article is a gallery on it’s own.)
  3. Now under advanced prefs we create a customfield and name it galleryname(Carefull,no spaces.)
  4. Create a gallery template with the following in your content division:<code>
    <div id=“content”>
    <txp:article form=“gallery_intro” section=“gallery” sortby=“posted” sortdir=“desc” listform=“gallery_teaser” />
    <txp:image_index wraptag=“div” break=”“ />
    <txp:image_display />
    </div></code>(Remove all article tags from the default template), save as gallery and assign it to your gallery section template..
  1. As we can see,we need two forms to get the necessary output on the different page calls: gallery_intro and gallery _teaser.
    So save the following code under gallery_intro as article form:
    <code><a href=”/gallery/?c=<txp:custom_field name=“galleryname” />” title=“Watch gallery”><txp:article_image /></a><txp:posted /> by <txp:author />
    <txp:body /></code> For the listform output we need to save the following as gallery_teaser as an article form again.
    <code><txp:wet_article_thumb /><txp:posted /> by <txp:author />
    <txp:body /><h3>View the<txp:custom_field name=“galleryname” /></h3></code>
  1. Now I go under article write und publish an article that is assigned to the gallery section and has the firstgallery category(This is optional and basically not needed,but just mentioned here with the Idea of extensibility and structure in mind.Let’s say you wan’t to archieve and document big image galleries and you would like to add additional information to the core forms.)
    What is important now is to insert the categoryname again in your custom field ,in this case “firstgallery”.
    Repeat same for secondgallery
    For each new gallery that gets listed in our gallery landing page the only thing needed is to publish an article, insert a new image category into the galleryname custom field ,assign a teaser image id number in the article image field and you have a full blown gallery in place (with the prerequisite that you have set up the category gallery names,created the thumbnails and assigned your images to the correspondent category.)

with best rgrds, marios

Last edited by marios (2005-11-27 08:34:54)

⌃ ⇧ < ⌃ ⇧ >


#2 2006-01-30 16:46:54

New Member
Registered: 2006-01-27
Posts: 4

Re: [howto] Gallery Archive template without plugins

This is a great example, thank you very much. I was wondering though, is it possible to have the gallery_intro form display the thumbnails? What I mean I guess, is it possible to just bypass the intro and go straight to the thumbs?


#3 2006-01-30 19:14:40

New Member
Registered: 2006-01-27
Posts: 4

Re: [howto] Gallery Archive template without plugins

Nevermind, just change the gallery_teaser form to this:

<div class="gallery_teaser"><a href="/gallery/?c=<txp:custom_field name="galleryname" />" title="Watch gallery"><txp:wet_article_thumb link=0 /><br /><txp:body /></a></div>

Last edited by sterling (2006-01-30 19:19:01)


Board footer

Powered by FluxBB