You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Johnny Jones <ja...@hotmail.com> on 2005/06/16 02:18:03 UTC

implementing multiple menus

Hi,
   Currently I am trying to implement two different menus to display 
documents instead of the same menu everytime.  One of the method I was 
trying to do was going inside pub/lenya/xslt/navigation/menu.xsl,
and in there, I copy and paste the code for the old menu and rename it as 
follow:
  <div id="menu2">
    <table width="100%" border="0" cellpadding="0" cellspacing="5"   
background="/lenya/unizh/authoring/images/TACb_lfbg_192x400.gif" 
height="400">
<xsl:apply-templates name="nav:node"/>

<tr><td height="100%"></td></tr>
</table>
  </div>

The problem that I am having is that whenever I call the original menu or 
the new menu ( menu2 ), this code always being applied:

<xsl:template match="nav:node
[          not(ancestor-or-self::nav:node[@current = 'true']) and
           not(descendant-or-self::nav:node[@current = 'true']) and
           not(..//nav:node[@current = 'true'])
]"/>

This means that the current page sibblings and descending are being display. 
  However, I want the option to be able to
display all of the page being created.  This means I need to find a way to 
overide the above rule for each new menu I created.  Can you give me some 
advice on any techniques I can try so that each
menu I created will have a unique rule associated with it?   I have tried 
many different ways to get around with the problem I mentioned above, but so 
far it all failed.  My biggest obtacles is tha
t I cannot declare the exclude-result-prefixes="nav" twice, so I cannot 
match up two different rule for the two menu.

I also tried other suggestion that I recieved from the mailing list.  I 
followed some advice by visiting http://solprovider.com/lenya/ and read 
everything about Sitemaps, Usecase Sitemaps, and Webs
ite Map.  I then tried to follow the direction to build a map of all the 
pages in my publication, but I kept getting the following error whenever I 
click on the link to go to the map:

org.apache.cocoon.ResourceNotFoundException: No pipeline matched request: 
ActingClasses/authoring/table.html
cause: org.apache.cocoon.ResourceNotFoundException: No pipeline matched 
request: ActingClasses/authoring/table.html

It seems to me that lenya have a hard time Usecase Sitemaps, but I am not so 
sure if that I is really the cause.  I also notice from the online 
direction, one of the step said "To add a link to the
map to your XSL, use:
<A HREF="{$url}?lenya.usecase=map"><i18n:text>Sitemap</i18n:text></A>".  I 
am not sure what should be in place of {$url}, so I just give the url of the 
current page that has the link to the map.

It would be great if you give me more suggestion on what I have to do 
because I have been stuck with the problem that I mentioned above for a very 
long time and so far I have not made any progress
yet.

Thanks in advance for your help.

_________________________________________________________________
Don’t just search. Find. Check out the new MSN Search! 
http://search.msn.click-url.com/go/onm00200636ave/direct/01/


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: implementing multiple menus

Posted by Andreas Hartmann <an...@apache.org>.
Johnny Jones wrote:

[...]

> This means that the current page sibblings and descending are being 
> display.  However, I want the option to be able to
> display all of the page being created.  This means I need to find a way 
> to overide the above rule for each new menu I created.  Can you give me 
> some advice on any techniques I can try so that each
> menu I created will have a unique rule associated with it?

Could you explain this a little more detailed?
I have to admit I don't really understand what you try to achieve.
Apart from that, I'm sure there will be a solution :)

-- Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: implementing multiple menus

Posted by Andreas Hartmann <an...@apache.org>.
solprovider@gmail.com wrote:

[...]

> Usecases work great.  Most functionality belongs in Usecases.  The
> whole CMS could/should have been implemented as Usecases (which would
> remove the authoring/live "areas".)

Just FYI: In 1.4, the info area prefix was removed from the URL
and replaced by usecases which work in the authoring area, just
changing the GUI. The admin area is basically a set of usecases
as well.

-- Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: implementing multiple menus

Posted by so...@gmail.com.
On 6/15/05, Johnny Jones <ja...@hotmail.com> wrote:
>    Currently I am trying to implement two different menus to display
> documents instead of the same menu everytime.  One of the method I was
> trying to do was going inside pub/lenya/xslt/navigation/menu.xsl,
> and in there, I copy and paste the code for the old menu and rename it as
> follow:
>   <div id="menu2">
>     <table width="100%" border="0" cellpadding="0" cellspacing="5"
> background="/lenya/unizh/authoring/images/TACb_lfbg_192x400.gif"
> height="400">
> <xsl:apply-templates name="nav:node"/>
> <tr><td height="100%"></td></tr>
> </table>
>   </div>

Issue #1: You are mixing function and form.  menu.xsl is meant to
transform the sitemap into a data structure of DIVs.  Use later XSL
(page2xhtml.xsl) with CSS to add formatting such as a TABLE.

> The problem that I am having is that whenever I call the original menu or
> the new menu ( menu2 ), this code always being applied:
> 
> <xsl:template match="nav:node
> [          not(ancestor-or-self::nav:node[@current = 'true']) and
>            not(descendant-or-self::nav:node[@current = 'true']) and
>            not(..//nav:node[@current = 'true'])
> ]"/>
> This means that the current page sibblings and descending are being display.
>   However, I want the option to be able to
> display all of the page being created.  This means I need to find a way to
> overide the above rule for each new menu I created.  Can you give me some
> advice on any techniques I can try so that each
> menu I created will have a unique rule associated with it?   I have tried
> many different ways to get around with the problem I mentioned above, but so
> far it all failed.  My biggest obtacles is tha
> t I cannot declare the exclude-result-prefixes="nav" twice, so I cannot
> match up two different rule for the two menu.

Issue #2: If you want a new navigation control, create a new
navigation control.  Do not try to overload an existing control. 
Rather than copy paste inside menu.xsl, copy menu.xsl to menu2.xsl. 
Change menu2.xsl to fit your needs, and add menu2.xsl to your
pipeline.  That was how I created map.xsl, then I rewrote much of it.

> I also tried other suggestion that I recieved from the mailing list.  I
> followed some advice by visiting http://solprovider.com/lenya/ and read
> everything about Sitemaps, Usecase Sitemaps, and Website Map.  

It sounds like I did not explain everything well.  I just added a few
notes.  Let me know if anything else is not understandable.

> I then tried to follow the direction to build a map of all the
> pages in my publication, but I kept getting the following error whenever I
> click on the link to go to the map:
> org.apache.cocoon.ResourceNotFoundException: No pipeline matched request:
> ActingClasses/authoring/table.html
> cause: org.apache.cocoon.ResourceNotFoundException: No pipeline matched
> request: ActingClasses/authoring/table.html

Issue #3: Something is wrong.  This probably was caused by the HTML in menu.xsl.

> It seems to me that lenya have a hard time Usecase Sitemaps, but I am not so
> sure if that is really the cause.  

Usecases work great.  Most functionality belongs in Usecases.  The
whole CMS could/should have been implemented as Usecases (which would
remove the authoring/live "areas".)  Usecases are getting an overhaul
for Lenya 1.4; I have no idea what has changed, but hopefully they
will become even more useful.

> I also notice from the online
> direction, one of the step said "To add a link to the
> map to your XSL, use:
> <A HREF="{$url}?lenya.usecase=map"><i18n:text>Sitemap</i18n:text></A>".  I
> am not sure what should be in place of {$url}, so I just give the url of the
> current page that has the link to the map.

Bad documentation.  I use {pub} in directory names to mean replace
with your publication directory.  {$url} is an XSL variable.  The
pipeline should pass the url as a parameter to the XSL.  The XSL
should have an xsl:param near the top.  The variable will be replaced
by the XSL engine; it is not meant to be replaced manually.

---
Start over.
1. Restore the original menu.xsl.
2. Make a copy of the file and call it menu2.xsl.
3. Change the DIV to:
  <div class="menu2" id="menu2">
4. Change the rest to produce what you want.
5. Add menu2.xsl to your pipeline.  (Just copy the navigation/menu line.)
6. Add this line to your page2xhtml.xsl:
   <xsl:apply-templates select="xhtml:div[@id = 'menu2']"/>
7. See what you get.  Then keep fixing the XSL and CSS until it does
what you want.

solprovider

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org