Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-03-21 00:50:34

damienbuckley
Member
From: Brisbane, QLD, AU
Registered: 2006-02-24
Posts: 138
Website

Filtering or looping through categories - possible or no?

I am working on a site which has 40+ surgeons which are categorised by their specialty (Orthopaedic / ENT etc) – some in more tha one category. Additionally, they are also categorised by the locations they visit / service – some several. Due to the numbers of categories required for each article – up to 8 for some, I’ve used rss_unlimited_categories.

This all works well – I’ve been able to use the rss_uc_list to navigate to the articles by either specialty or location. Now the client has asked if we can filter by using both – for example click on a location eg: Brisbane, this brings up the full list of surgeons in the Brisbane area – then we click on Orthopaedic Surgeon, we then get a list of Orthopaedic Surgeons in the Brisbane area.

As the category lists are not looping through the current category – currently I can only achieve one or the other but not both. This doesnt seem like a complex requirement but I’ve no idea how to achieve it. Has anyone else dealt with or solved this problem?

Offline

#2 2008-03-21 01:49:15

masa
Member
From: Asturias, Spain
Registered: 2005-11-25
Posts: 1,091

Re: Filtering or looping through categories - possible or no?

I’ll admit right away, that this is over my head, but it has been discussed here before.

Does that help?

Offline

#3 2008-03-21 02:40:48

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Filtering or looping through categories - possible or no?

So you want to view multiple categories at once? txp:article_custom can show multiple categories, but to be able to access mutiple categories with txp:article is more difficult.

Well this works, I use this kind of solution:

<txp:php>
	echo article_custom(array(
		'category' => gps('category'),
	));
</txp:php>

Then you should select multiple categories via url: ?category=c1,c2,c3

Last edited by Gocom (2008-03-21 02:41:42)

Offline

#4 2008-03-21 02:52:55

damienbuckley
Member
From: Brisbane, QLD, AU
Registered: 2006-02-24
Posts: 138
Website

Re: Filtering or looping through categories - possible or no?

Gocom wrote:

So you want to view multiple categories at once? txp:article_custom can show multiple categories, but to be able to access mutiple categories with txp:article is more difficult.

What I’m trying to do is filter categories ie;

1) List showing all articles under global ‘specialists’ category
2) Click – ‘location’ category link – list shows only articles under specified location category.
3) Click – ‘specialty’ category – list shows only articles of specified specialty in the prior selected location

Last edited by damienbuckley (2008-03-21 02:53:17)

Offline

#5 2008-03-21 03:23:55

damienbuckley
Member
From: Brisbane, QLD, AU
Registered: 2006-02-24
Posts: 138
Website

Re: Filtering or looping through categories - possible or no?

masa wrote:

I’ll admit right away, that this is over my head, but it has been discussed here before.

Does that help?

Thanks for the suggestion but having read through some of that stuff it seems to be difficult – plus I’m using rss_unlimited_categories as I need multiple locations & specialties etc and none of the examples and / or otherwise available plugins discuss working with rss_uc. Also I didnt seem to be able to get chh_article_custom working at all – perhaps a 4.0.6 issue…

Last edited by damienbuckley (2008-03-21 03:25:24)

Offline

#6 2008-03-21 09:07:35

bancroft
Member
Registered: 2005-09-30
Posts: 39

Re: Filtering or looping through categories - possible or no?

You should be able to do everything you need with rss_uc. For the category menus I’d use rss_unlimited_categories_list and for the articles I’d use rss_unlimited_categories_related or rss_unlimited_categories_article_list.

As a quick example:

Menus

<txp:rss_unlimited_categories_list section=“section1,section2,etc” parent=“location” wraptag=“ul” break=“li” label=“Filter by location” labeltag=“h2” />

<txp:rss_unlimited_categories_list section=“section1,section2,etc” parent=“specialties” wraptag=“ul” break=“li” label=“Filter by specialty” labeltag=“h2” />

Articles

<txp:rss_unlimited_categories_related section=“section1,section2,etc” form=“myform”/>

Still a bit early for me at the moment so I could be way off, still, worth a try.

Which doesn’t help in you in any way regarding looping, I knew it was too early, sorry.

I think the only way it’s possible is if for instance you’re on Brisbane, all the surgeons are loaded in the page at the same time and then are viewed via a bit of show/hide js.

Last edited by bancroft (2008-03-21 09:18:30)

Offline

#7 2008-03-21 23:00:10

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Filtering or looping through categories - possible or no?

What about tagging? There’s a tagging plugin somewhere, and typically tags are combinable, though I don’t know if the plugin supports that.

Offline

Board footer

Powered by FluxBB