Tuesday 10 January 2006 7:22:04 am
hello, I'm working on a site where pages are build with an XML Block. I'm looking for a way to build a table of content of the page from the XML Block content.
For example : My XML Block :
<header level='1' anchor_name='t1'>title 1</header>
Lorem ipsum dollor...
<header level='1' anchor_name='t2'>title 2</header>
Lorem ipsum dollor...
and I'd like to automaticaly generate :
<ul>
<li><a href="#t1">Title 1</a></li>
<li><a href="#t2">Title 2</a></li>
</ul>
I have already thought to write an operator (http://ez.no/products/ez_publish_cms/documentation/development/extensions/template_operator ) that returns an array from the XML Block containing the anchors but I wonder if there is a better (easier) solution ?
Damien
Planet eZ Publish.fr : http://www.planet-ezpublish.fr
Certification : http://auth.ez.no/certification/verify/372448
Publications about eZ Publish : http://pwet.fr/tags/keywords/weblog/ez_publish
|