Developer forum

Forum » Templates » List unique names

List unique names


Reply
Hi all.

I am currently working on a site where I need to make a list of cities and the addresses/streets within each city below.

It should look something like this:

City 1
- Street name 1
- Street name 2
- Street name 4


City 2
- Street name 3
- Street name 9

etc. - I hope you get the point.

In the XML each street has a tag for which city their are connected to. But how do I make it list somewhat like the above?

(XML is a bout like this:
<item><row.category>city</row.category><row.value>copenhagen</row.value><row.category>street</row.category><row.value>street 1</row.value></item>

Replies

 
Reply
Hi Jannik

Yes I get the point ...

Grouping is one og the problems with XSLT/xPath 1.0.
What you looking for is a method called 'The Muenchian Method'.
Link: http://www.jenitennison.com/xslt/grouping/muenchian.html

It's a bit hard to get a hold on, but I've attached an example for the Sitemap V2 module that groups all pages alphabetically grouped by the letter.

// Sebastian
 
Reply
Awesome :)

I'll look into this. Thank you for the quick answer.

 

You must be logged in to post in the forum