Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2004-03-05 13:25:54

Dean
Founder (Gone, but not forgotten)
From: Languedoc
Registered: 2004-02-14
Posts: 235
Website

Using the new image gallery tags

First, you must upload fullsize images and corresponding thumbnails, and make sure each is in a specific category (keep the image category names simple: without spaces if possible, ‘newyear_2004’ for example).

To make an image gallery page:

  1. Create a new Page called something like ‘photo_page’
  2. Create a new section called something like ‘photo’, and tell it to use ‘photo_page’.
  3. In photo_page, put the tag <txp:image_index /> wherever you want the index to appear: a good idea would be to use a <div> and css to govern the space available for the index, and how the <img /> tags should be positioned.
  4. Wherever you want the fullsize image to appear on the page, put a <txp:image_display /> tag.

Then to call the gallery page (provided it is in the section ‘photo’), use:

your-txp-site.com/photo/?c=IMAGECATEGORY

(there will be a cleaner url method for this soon)


text*

Offline

#2 2004-03-05 17:20:40

mamash
Member
From: Prague
Registered: 2004-02-21
Posts: 127
Website

Re: Using the new image gallery tags

> there will be a cleaner url method for this soon

Actually, there is only the clean method and not a messy one. You have hardcoded the ‘clean’ method in taghandlers.php(667). :)


Who’s gonna textdrive you home tonight?

Offline

#3 2004-03-05 17:31:15

Dean
Founder (Gone, but not forgotten)
From: Languedoc
Registered: 2004-02-14
Posts: 235
Website

Re: Using the new image gallery tags

Yes, I should have added that for now this will only work for sites running under clean url mode.


text*

Offline

#4 2004-03-06 00:28:23

eVilosity
New Member
From: Halifax, NS
Registered: 2004-02-26
Posts: 7
Website

Re: Using the new image gallery tags

Well, the new tags work great.
However (you knew there was gonna be a however, didn’t ya?), is there, or will there be a way to output the caption text for each picture?

Offline

#5 2004-03-06 04:38:48

january
New Member
From: Treasure Coast, Florida
Registered: 2004-02-23
Posts: 9
Website

Re: Using the new image gallery tags

Alright, again, going to sound really stupid, but I simply cannot figure these tags out. Actually, I’m having trouble with trying to use any tags that aren’t coming pregenerated from txp. One of these days, I’m sure I’ll get it, but for right now, it’s just not working.

Would any kind soul be willing to put up a little example of exactly how these tags should work in a page? Here are some variables. If I have an image category called say…fruit and I have five images in that category, how do I use the image_index tag to display those five images. And then how would I insert those five images into a page using the img tags?

Additionally, is there a list anywhere of all of the variables you can use in a tag? For example, I know you can use section and category, but what are the others?

Offline

#6 2004-03-06 09:03:08

mamash
Member
From: Prague
Registered: 2004-02-21
Posts: 127
Website

Re: Using the new image gallery tags

The preconditions:
  1. You have followed Dean’s list above.
  2. You are editing a page that is assigned to the photo section you created.
Then:
  • image_index anywhere in the page code gets substituted for a simple list of image thumbnails, provided the page is called as /(photo section name)/?c=(image category).
  • image_display anywhere in the page code gets substituted for a simple image tag, provided the page is called as /(photo section name)/?c=(image category)&p=(photo id).

That means you would have to call the gallery as domain.com/photo/?c=fruit and the image_index (if present) will generate a list of image links that go like domain.com/photo/?c=fruit&p=2.

If you wanted to create a gallery similar to the one Dean has on textism.com, you would include both image_index and image_display on a single page design. The single photos would then only display if the visitor clicked on one of the image thumbnails.


Who’s gonna textdrive you home tonight?

Offline

#7 2004-03-06 10:45:31

Dean
Founder (Gone, but not forgotten)
From: Languedoc
Registered: 2004-02-14
Posts: 235
Website

Re: Using the new image gallery tags

Here’s a couple page templates to get started. Neither depend on external CSS.

Remember that you need not put anything else inside <txp:image_index /> and <txp:image_display /> tags, they can figure out what image and/or index to show by the URL that calls the page.

Basic,


text*

Offline

#8 2004-03-06 10:50:45

Dean
Founder (Gone, but not forgotten)
From: Languedoc
Registered: 2004-02-14
Posts: 235
Website

Re: Using the new image gallery tags

> is there, or will there be a way to output the caption text for each picture?

Next update, mkay?


text*

Offline

#9 2004-03-06 12:21:17

january
New Member
From: Treasure Coast, Florida
Registered: 2004-02-23
Posts: 9
Website

Re: Using the new image gallery tags

Thanks Dean and Mamash…I swear I was trying all night, different variations of those tags and getting nothing but a blank page outputted. But it works now! Thanks so much!

Offline

#10 2004-03-06 14:33:06

eVilosity
New Member
From: Halifax, NS
Registered: 2004-02-26
Posts: 7
Website

Re: Using the new image gallery tags

> Dean wrote:

Next update, mkay?

Sounds good – thanks.

Offline

#11 2004-03-07 16:11:04

raveoli
Member
From: Copenhagen
Registered: 2004-03-06
Posts: 205
Website

Re: Using the new image gallery tags

> Dean wrote:

> Yes, I should have added that for now this will only work for sites running under clean url mode.

Then how about the messy one? Does it work now?

Btw, all this clean/messy is pretty “messy” — Why not just have one URL mothod, to have some standardization?

To me, the messy URL seems easier to do and understand than the clean ones…

Anyway, how can I do a nice photoindex in messy-mode?

Offline

#12 2004-03-07 17:00:13

mamash
Member
From: Prague
Registered: 2004-02-21
Posts: 127
Website

Re: Using the new image gallery tags

The messy URLs work always, but are not user and search engine friendly. The clean URLs only work when your server supports .htaccess overrides OR mod_rewrite.

To use messy URLs with 1.15’s photo features, you have to hack the publish/taghandlers.php file and change its 667 into:

<code>
$out[] = ‘<a href=”’.$pfr.’?s=’.urlencode($s).a.‘c=’.urlencode($c).a.‘p=’.$id.’”>’.
</code>

Last edited by mamash (2004-03-07 17:01:25)


Who’s gonna textdrive you home tonight?

Offline

Board footer

Powered by FluxBB