Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
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. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
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)
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
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. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: Portfolio images under two locations
Just so happens I did something similar on a project just the other day. Welcome!
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
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. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Pages: 1