I tried a little bit ...
What do you think?
Ted, are that links ok?
Jan
docs/resources.html
- generated (test) page
xdocs/resources.xml (testversion, only two books)
- added "isbn" attribute to <subsection>
<subsection name="Ant: The Definitive Guide, 2nd edition" isbn="0596006098">
xdocs/stylesheets/site.vsl
- add´s marked with "##MAT-bookstore"
- new macro for inserting the link to external partners
- invocation of that macro from #subsection, only if there is an "isbn"-attribute
#macro ( subsection $subsection)
...
#if ($subsection.getAttributeValue("isbn"))
#set ($isbn = $subsection.getAttributeValue("isbn"))
#isbn ($isbn)
#end
#end
#macro ( isbn $isbn)
<p><b>Available from:</b><br>
<a href="" /$!isbn/apachesoftwar-20/" target="_blank">Amazon.com</a>
| <a href="" &sourceid=41462544&bfpid=$!isbn" target="_blank">Barnes & Noble</a>
| <a href="" ?affiliateId=Apache&isbn=$!isbn" target="_blank">Book Sense</a>
| <a href="" ?isbn=$!isbn&partner_id=29693" target="_blank">Powells.com</a>
<br></p>
#end
xdocs/stylesheets/templates.vm
- add´s marked with "##MAT-bookstore"
- if that info (isbn) is present, why not show that in the table
#macro ( table $table)
...
#if ($table.getParent().getAttributeValue("isbn"))
#set ($isbn = $table.getParent().getAttributeValue("isbn"))
<tr><th>ISBN:</th><td>$!isbn</td></tr>
#end
</table>
#end
> -----Ursprüngliche Nachricht-----
> Von: Stefan Bodewig [mailto:[EMAIL PROTECTED]]
> Gesendet am: Dienstag, 24. Mai 2005 14:46
> An: dev@ant.apache.org
> Betreff: Re: Online Bookstore
>
> On Tue, 24 May 2005, Jan Materne <[EMAIL PROTECTED]> wrote:
>
> > The idea is
> > - store the ISBN in an extra tag in the xdoc
> > <th>ISBN:</th> <th id="isbn"> ... </th>
> > - use the VM makro to generate the link passage
>
> Ahh, thanks.
>
> +1
>
> Stefan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]