Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-09-06 15:15:17

njprrogers
New Member
From: Dublin
Registered: 2008-08-30
Posts: 9
Website

Image Category List

I’m trying build a photo gallery with some links to all existing image categories.

I’m using <txp:image_index /> and image display and I’m hoping to build a link which will look somthing like <txp:site_url />gallery/c=imagecategories.

I’ve created a gallery section, a gallery page calling the image commands and my navigation is currently held in a misc form called by the gallery page.

Help!

Last edited by njprrogers (2008-09-06 15:19:42)

Offline

#2 2008-09-06 15:41:15

joebaich
Member
From: DC Metro Area and elsewhere
Registered: 2006-09-24
Posts: 507
Website

Re: Image Category List

You could try <txp:category_list break="li" wraptag="ul" type="image" /> to generate your list of links to image categories in the appropriate place in your menu.

Offline

#3 2008-09-08 09:21:37

njprrogers
New Member
From: Dublin
Registered: 2008-08-30
Posts: 9
Website

Re: Image Category List

perhaps i have this structured incorrectly but the above code will create links to <txp:site_url>/category/image-category/ .

i’m trying to dynamically generate the links to my gallery section / page which would be <txp:site_url />gallery/?c=image-categories.

sample output would be <a href=“sitename/gallery/?c=image-categories”>image-categories</a>

ultimately i am looking to get a list of image categories and append them to my gallery section link. but i don’t see how i can manipulate the category_list command to do this at the moment…

Offline

#4 2008-09-08 11:52:27

joebaich
Member
From: DC Metro Area and elsewhere
Registered: 2006-09-24
Posts: 507
Website

Re: Image Category List

Nick,

From your first post, I assumed that your gallery content is based on the image category, one category per gallery kind of thing. As you noted, <txp:category_list break="li" wraptag="ul" type="image" /> will produce links to <txp:site_url>/category/image-category/. The following code in the appropriate place in a page template at that URL will produce a list of items in the invoked category link that could, for instance, include a thumbnail linked to the main picture(s).

<txp:if_category>
<h2>The <txp:category title="1"/> Pictures in the Collection</h2>
<txp:article limit="999" listform="yourpictures_catlist" sort="Title" />
</txp:if_category>

The code in the listform governs how the thumbnails or pictures that match the invoked category are presented. The main picture would be at <txp:site_url>/gallery/image article name/.

Offline

Board footer

Powered by FluxBB