Koen Pellegrims wrote:
> Menu on my site that contains a link to the index-page (index.html) and
> links to (among others) a product-page. In the page-hierarchy, the
> product-pages are contained within a 'products' directory.
...
> The problem arises when I display this menu on a product page, because the
> browser (rightly so) interprets 'index.html' as being relative to the
> 'products'-directory.
>
> So, whereas the link to 'index.html' is correct from the index-page, it
> refers to 'products/index.html' on any product page. (and even worse: a link
> to productA suddenly becomes a link to products/products/productsA.html)
>
> My question is simple: did any of you encounter this problem? And -of
> course- how did you solve it?
Use absolute URLs in menus. I pass a parameter to my XSLT
for the prefix
<a href={$root}/product/productA.html>...
so that the tree navigated by the menu can be easily reparented.
Other possibilities use relative URLs and pass nesting depths.
I can imagine only two possibilities not using XSLT:
- Use frames and let the menu get its own frame (has its own set of
disadvantages)
- Use long filenames instead of paths and a Cocoon regexp matcher to
map them
URL products-productA -> mapped to /products/productA
No nested directories -> no problems with relative URLs. :-)
J.Pietschmann
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>