Re: [greenstone-users] how to Hierarical list?

From Stefan Boddie
DateSat, 3 May 2003 15:58:54 +1200
Subject Re: [greenstone-users] how to Hierarical list?
In-Reply-To (20030430091312-4959-qmail-webmail30-rediffmail-com)
>
> During the builduing phase of collection i am facing a problem.
>
> I made a collection of some midi files and want to generate a
> hierarical list by singer name.
>
> i too want to change the verical listing of item in customised
> way. like
>
> singer1
> |
> - abc[some title with link]
> |
> - bcd[some title with link]
> as i change the vertical list format it also change the parent
> node format. can any body help me by telling how to write format
> command
> in configuration file.
>
> i wrote....as
>
> classify Hierarchy -hfile sing.txt -metadata Singer -sort Title
> -buttonname Singer
>
>
> format VList '<td>[srclink]<img
>
src="/gsdl/images/imidi.gif">[/srclink]</td><td>[Title]<br><i><small>
Singer:
> [Singer]{If}{[Date],<br>[Date]}</small></i></td>'
>

Try using the format statements If clause to test for top level nodes.
Something like the following:

format VList '{If}{[parent:Title],<td>[srclink]<img
src="/gsdl/images/imidi.gif">[/srclink]</td><td>[Title]<br><i><small>
Singer:
[Singer]<br>[Date]</small></i></td>,<td>[link][icon][/link]</td><td>[Title]<
/td>}'

This tests to see if the parent node has Title metadata set. If we're
already at the top level the parent of that level (which doesn't exist) will
have no Title metadata so the second part of the If clause will be used. For
lower level nodes the first clause will be used.

Hope this helps.

Stefan.