I'm looking to include a list of resource categories and their resources on a page of a site. The resources are under a node of id 1094 and they're of the structure:
- Resource category name 1 -- Resource name 1 -- Resource name 2 -- Resource name 3 -Resource category name 2 -- Resource name 4 -- Resource name 5 etc, etc.
I want to put this into a macro so that the client can embed the macro on the page and have it render as:
<h3>Resource category name 1</h3> <h4>Resource name 1</h4> <h4>Resource name 2</h4> <h4>Resource name 3</h4> <h3>Resource category name 2</h3> <h4>Resource name 4</h4> <h4>Resource name 5</h4>
The resource document type has a property called 'showElsewhere' (true/false). Now I only want to list the resource if it has this property set to true, and also only show the resource category title if it has any resources under it which have the property set to true.
List children and parent if child has property
Hi,
I'm looking to include a list of resource categories and their resources on a page of a site. The resources are under a node of id 1094 and they're of the structure:
- Resource category name 1
-- Resource name 1
-- Resource name 2
-- Resource name 3
-Resource category name 2
-- Resource name 4
-- Resource name 5
etc, etc.
I want to put this into a macro so that the client can embed the macro on the page and have it render as:
I've managed to do this with the following code:
The resource document type has a property called 'showElsewhere' (true/false). Now I only want to list the resource if it has this property set to true, and also only show the resource category title if it has any resources under it which have the property set to true.
Can anyone see how to do this?
Thanks all...
Hi Dan,
This is a good example of where you'd let XSLT do its thing, and just define the templates for the output you want:
/Chriztian
Very nice indeed - I'm going to read up on XSLT templates this weekend I reckon, thanks Chriztian!
is working on a reply...