Textpattern Forum

You are not logged in. Register | Login | Help

#1 2012-06-22 20:25:29

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,714
Website

Portfolio images under two locations

A site owner has asked me to implement a client portfolio, updateable by the site owner as more work comes their way. Essentially a “look at who I’ve helped”. The page layout they want is:

  • Client list down the side. Click a client to see…
  • … thumbnails along the bottom. Click one of them to see…
  • … larger image above

Fair enough, I thought: Image category tree:

  • Portfolio
    • Client A
    • Client B
    • Client C

with some <txp:images> goodness and I’ll be pretty close to being there. Then they threw the curve ball that, beneath the client list, they’d like a list of industries that those clients represent, thus the images could appear in both places, just grouped differently depending on how the visitor wants to slice n dice. The closest I can find in the wild is something like this I guess. Ish.

The only way I can think of approaching it, besides employing smd_tags which seems overkill (hmmm, or maybe not) is to use an article container for each client in a portfolio section and use Category1 or 2 as the Industry filter so I can give the second (category) list below the usual (article) list. They’d have to upload images separately of course and assign the IDs to article image, but I’m sure a plugin or two can ease that workflow a bit.

My question is that it seems a bit hackish to do that for the sake of two pointers to the same image. Anybody got any better ideas on how to approach it and keep it simple for the client? Thanks in advance.

Last edited by Bloke (2012-06-22 20:27:05)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#2 2012-06-22 21:17:41

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,176
Website

Re: Portfolio images under two locations

Industry is a category and Client is a child category under an Industry?

Last edited by MattD (2012-06-22 21:18:21)


My Plugins

Piwik Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#3 2012-06-22 21:26:14

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,714
Website

Re: Portfolio images under two locations

MattD wrote:

Industry is a category and Client is a child category under an Industry?

Oooh, I like it. If I can tame <txp:category_list> with some clever children / exclude attributes, that might just allow me to output both level 2 and level 3 categories as separate lists. Awesome, thanks.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#4 2012-06-22 23:39:08

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,176
Website

Re: Portfolio images under two locations

Just so happens I did something similar on a project just the other day. Welcome!


My Plugins

Piwik Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#5 2012-06-23 00:30:11

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,714
Website

Re: Portfolio images under two locations

In case anybody wants a similar solution in future, MattD is spot on. This works a charm:

<!-- Store a list of 'level 2' categories -->
<txp:variable name="industries"><txp:category_list type="image" parent="portfolio" exclude="portfolio" children="0" break=","><txp:category /></txp:category_list></txp:variable>

Clients:

<!-- Everything except root ('portfolio') and any level 2 categories -->
<txp:category_list type="image" parent="portfolio" exclude='portfolio, <txp:variable name="industries" />' wraptag="ul" break="li" />

Industries:

<!-- Just the level 2 categories, without root ('portfolio') or children -->
<txp:category_list type="image" categories='<txp:variable name="industries" />' children="0" parent="portfolio" exclude="portfolio" wraptag="ul" break="li" />

Sweet! Thanks again.

Last edited by Bloke (2012-06-23 00:30:25)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB