forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Koberg" <...@koberg.com>
Subject RE: [PATCH] fix tabs
Date Wed, 11 Sep 2002 13:44:37 GMT
Hi,

It is a good step. It is still not optimal. There is still a big problem. It
should not happen often, but sometimes it does (at least for me). Or you do not
allow it because the system you are using is not flexible enough.

What if the client/user wants to move a page or even worse, a folder. You have
all these hard coded links everywhere that need to be changed.

The page located at /f1/f2/page.html was moved for some reason
<link href="/f1/f2/page.html"/>
needs to be switched to
<link href="/f1/f3/page.html"/>

Someone or thing needs to go back in and change all those links. This is
unnecessary.

If links were able to get their href from a page/resource UID referenced in the
link, and build the path at page generation time (or whenever) then this would
not be a problem.

best,
-Rob




> -----Original Message-----
> From: Bert Van Kets [mailto:bert@vankets.com]
> Sent: Wednesday, September 11, 2002 6:11 AM
> To: forrest-dev@xml.apache.org
> Subject: Re: [PATCH] fix tabs
>
>
> Great solution!
> Wish I thought of this a long time ago.
> Congrats Jef!
> Thanks Konstantin for implementing this.
> Bert
>
> At 16:52 10/09/2002 +1000, you wrote:
> >Hi,
> >
> >This patch fixes tabs on Forrest-based websites. In the current
> >tab2menu.xsl, there is a hardcoded '/forrest' context path:
> >
> ><a href="/forrest/{@dir}">
> >
> >Which a) makes tab2menu.xsl unusable for non-Forrest sites, and b) forces
> >the Forrest context to be '/forrest'. Also because it's trying to be
> >server-relative, the links are broken on static local docs: they appear
> >as file:///forrest/community/howto/index.html
> >
> >My fix is to make the generated link relative. As the link must be
> >relative to the current directory, I've written an XSL, dotdots.xsl,
> >which returns the appropriate number of ../'s to negate the current tab's
> >directories. From the file's description. Here's the examples:
> >
> >Examples:
> >   Input                           Output
> >     index.html                    ""
> >     dir/index.html                "../"
> >     dir/subdir/index.html         "../../"
> >     dir//index.html              "../"
> >     dir/                          "../"
> >     dir//                         "../"
> >     \some\windows\path            "../../"
> >     \some\windows\path\           "../../../"
> >     \Program Files\mydir          "../"
> >
> >Anyway, it's used in tab2menu.xsl to work out the correct links for
> >non-selected tabs. So if the user is in community/howto/index.html, the
> >'Home' link goes to ../../
> >
> >I have also modified the sitemap to allow linking to directories. Links
> >to '**/' are now redirected to '**/index.html'. Without this, tabs were
> >broken in the live webapp, since each tab is a directory link. Statically
> >generated sites worked because (presumably) the crawler rewrites links to
> >'directory/' to 'directory/index.html'.
> >
> >Also, previously directories in tabs.xml had to end in '/':
> >
> >   <tab label="Home" dir=""/>
> >   <tab label="How-Tos" dir="community/howto/"/>
> >   <tab label="XML Site" dir="xml-site/"/>
> >
> >Now tab2menu.xsl adds a trailing '/' regardless, so it is no longer
> >required (although it won't hurt).
> >
> >I've verified that offline generation works correctly with this patch.
> >The NPEs, broken links and zillion FOP error messages are not my fault ;)
> >
> >
> >--Jeff
>



Mime
View raw message