You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by laurent <la...@videotron.ca> on 2004/08/13 17:23:25 UTC

Modify the layout

Hi all,

I'm completely new to lenya (and cocoon), I read many documentations 
these last days but it remains still much of confused things for me...
I'm trying to modify the layout of my index_* pages. I don't want to see 
the menu and breadcrumb in the home page.
For that, I added in the myPub/publication-sitemap.xmap file a new 
pipeline like that :

<map:pipeline>
<!-- /lenyabody-{rendertype}/{publication-id}/{area}/{doctype}/{url} -->
  <map:match pattern="lenyabody-*/*/*/*/index*">
  <map:aggregate element="cmsbody">
  <map:part src="cocoon://navigation/{2}/{3}/tabs/{5}.xml"/>
  <map:part src="cocoon://navigation/{2}/{3}/search/{5}.xml"/>
...
</map:pipeline>

I just copy the pipeline that builds the page and deleted the reference 
to menu and breadcrumb and put a pattern for index pages. However, 
nothing changed in my home page. What's wrong ? Is there a better way to 
do what I want ?
Help would be very appreciated.

Thanks for all.
Laurent

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


Re: Modify the layout

Posted by laurent <la...@videotron.ca>.
> Laurent, actually, what you need to do is create a brand new XSLT  
> stylesheet, not a new element name for the map:aggregate portion of the  
> pipeline.  Try this:
> 
> 1.  Go to <publication-name>/xslt/ and copy page2xhtml.xsl as home.xsl
> 
> 2.  Open up home.xsl and search for the places where it calls the menu  
> and breadcrumbs.  They look like this:  <xsl:apply-templates  
> select="xhtml:div[@id = 'breadcrumb']"/> and so forth...  Remove those  
> entries you do not want.
> 
> 2.  Go to your publication-sitemap.xmap and remove your extra  
> pipelines, keeping only the default Lenya pipeline for your pages.
> 
> 3.  Now, copy the default pipeline and make a new one, only changing  
> where it points to your stylesheet: <map:transform  src="xslt/home.xsl"/>
> 
> 4.  Also, for changes in your new pipeline, you remove the parts of the  
> <map:aggregate> tag that you do not want, like the breadcrumbs and the  
> menu.
> 
> 5.  Lastly, change the match/pattern part of the pipeline so that it  
> points to "lenyabody-*/*/*/*/index">  (no asterisk needed)
> 
> 6.  Save an exit, then go to your home page.  This *should* get you  
> want you need.
> 
> Post back if you need more help.  I was in the same boat as you about 2  
> months ago, so I understand the pain you are going through.  :)

Thank very much for your help Jon !

I followed all your explanations, however it still doesn't work !?
I don't understand what I missed.
Maybe the problem comes from the pattern since when I comment some link 
in the default pipeline, and point to home.xsl it works.
I noticed that there are no more links in tabs at this moment (?)... 
anyway I should firstly find how to publish my home page without menu.

Thanks again,
Laurent

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


Re: Modify the layout

Posted by Jonathan Linczak <li...@hiram.edu>.
On Aug 13, 2004, at 1:24 PM, laurent wrote:
> It doesn't work.
> Now I have a pipeline for cmshomebody in publication-sitemap.xmap :
> <map:pipeline>
>       <!--  
> /lenyabody-{rendertype}/{publication-id}/{area}/{doctype}/{url} -->
>       <map:match pattern="lenyabody-*/*/*/*/index*">
>         <map:aggregate element="cmshomebody">
>           <map:part src="cocoon://navigation/{2}/{3}/tabs/{5}.xml"/>
>           <map:part src="cocoon://navigation/{2}/{3}/search/{5}.xml"/>
>           <map:part  
> src="cocoon:/lenya-document-{1}/{3}/{4}/{page-envelope:document- 
> path}"/>
>         </map:aggregate>
>         <map:transform src="xslt/page2xhtml.xsl">
>           <map:parameter name="root"  
> value="{page-envelope:context-prefix}/{2}/{3}"/>
>           <map:parameter name="url" value="{5}"/>
>           <map:parameter name="document-id"  
> value="{page-envelope:document-id}"/>
>           <map:parameter name="document-type"  
> value="{page-envelope:document-type}"/>
>         </map:transform>
>         <map:select type="parameter">
>           <map:parameter name="parameter-selector-test" value="{1}"/>
>           <map:when test="view">
>         <map:transform type="link-rewrite"/>
>           </map:when>
>         </map:select>
>         <map:serialize type="xml"/>
>       </map:match>
>     </map:pipeline>

Laurent, actually, what you need to do is create a brand new XSLT  
stylesheet, not a new element name for the map:aggregate portion of the  
pipeline.  Try this:

1.  Go to <publication-name>/xslt/ and copy page2xhtml.xsl as home.xsl

2.  Open up home.xsl and search for the places where it calls the menu  
and breadcrumbs.  They look like this:  <xsl:apply-templates  
select="xhtml:div[@id = 'breadcrumb']"/> and so forth...  Remove those  
entries you do not want.

2.  Go to your publication-sitemap.xmap and remove your extra  
pipelines, keeping only the default Lenya pipeline for your pages.

3.  Now, copy the default pipeline and make a new one, only changing  
where it points to your stylesheet: <map:transform  
src="xslt/home.xsl"/>

4.  Also, for changes in your new pipeline, you remove the parts of the  
<map:aggregate> tag that you do not want, like the breadcrumbs and the  
menu.

5.  Lastly, change the match/pattern part of the pipeline so that it  
points to "lenyabody-*/*/*/*/index">  (no asterisk needed)

6.  Save an exit, then go to your home page.  This *should* get you  
want you need.

Post back if you need more help.  I was in the same boat as you about 2  
months ago, so I understand the pain you are going through.  :)

Jon


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


Re: Modify the layout

Posted by laurent <la...@videotron.ca>.
Jonathan Linczak a écrit :
> On Aug 13, 2004, at 12:16 PM, laurent wrote:
> 
>>
>>> Have you removed the xsl:apply-templates tags for breadcrumb and menu 
>>> in the XSLT stylesheet you are referencing in your pipeline above?
>>
>>
>> Hi Jon,
>>
>> Thanks for your response.
>>
>> Humm, no, I didn't remove the xsl:apply-templates tags (in 
>> page2hmtl.xslt ?) I thought remove the reference to menu and 
>> breadcrumb would be enough. So if I understand well I should create a 
>> new template in page2html.xsl ?
> 
> 
> 
> Ideally, yes, if you want your design to be different from the remaining 
> pages, it would probably be easier to manage to create a new XSLT 
> stylesheet and reference it in your pipeline you created.  You can do a 
> simple copy of the page2xhtml.xsl file as your starting point, but the 
> options for changing styling is endless, really.  Anyway, give it a go 
> on the new stylesheet and see what you come up with.

It doesn't work.
Now I have a pipeline for cmshomebody in publication-sitemap.xmap :
<map:pipeline>
       <!-- 
/lenyabody-{rendertype}/{publication-id}/{area}/{doctype}/{url} -->
       <map:match pattern="lenyabody-*/*/*/*/index*">
         <map:aggregate element="cmshomebody">
           <map:part src="cocoon://navigation/{2}/{3}/tabs/{5}.xml"/>
           <map:part src="cocoon://navigation/{2}/{3}/search/{5}.xml"/>
           <map:part 
src="cocoon:/lenya-document-{1}/{3}/{4}/{page-envelope:document-path}"/>
         </map:aggregate>
         <map:transform src="xslt/page2xhtml.xsl">
           <map:parameter name="root" 
value="{page-envelope:context-prefix}/{2}/{3}"/>
           <map:parameter name="url" value="{5}"/>
           <map:parameter name="document-id" 
value="{page-envelope:document-id}"/>
           <map:parameter name="document-type" 
value="{page-envelope:document-type}"/>
         </map:transform>
         <map:select type="parameter">
           <map:parameter name="parameter-selector-test" value="{1}"/>
           <map:when test="view">
         <map:transform type="link-rewrite"/>
           </map:when>
         </map:select>
         <map:serialize type="xml"/>
       </map:match>
     </map:pipeline>

And a new template "cmshomebody" in myPub/xslt/page2html.xsl without 
menu and breadcrumb :
<xsl:template match="cmshomebody">
   <html>
     <head>
       <link rel="stylesheet" href="{$root}/css/page.css" type="text/css"/>
     </head>
     <body>
       <div id="page">
       <table width="100%" cellpadding="0" cellspacing="0" border="0">
         <tr>
           <td id="publication-title"></td>
           <td id="project-logo"><img 
src="{$root}/images/header_01.jpg"/></td>
         </tr>
       </table>
       <xsl:apply-templates select="xhtml:div[@id = 'tabs']"/>
       <table width="100%" border="0" cellpadding="0" cellspacing="0">
         <tr>
           <td valign="top">
             <div id="main">
               <xsl:apply-templates select="xhtml:div[@id = 'search']"/>
               <xsl:apply-templates select="xhtml:div[@id = 'body']"/>
             </div>
           </td>
         </tr>
       </table>
       </div>
     </body>
   </html>
</xsl:template>

But when I reinstall, menu and breadcrumb are still there !

Thanks,
Laurent

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


Re: Modify the layout

Posted by Jonathan Linczak <li...@hiram.edu>.
On Aug 13, 2004, at 12:16 PM, laurent wrote:

>
>> Have you removed the xsl:apply-templates tags for breadcrumb and menu 
>> in the XSLT stylesheet you are referencing in your pipeline above?
>
> Hi Jon,
>
> Thanks for your response.
>
> Humm, no, I didn't remove the xsl:apply-templates tags (in 
> page2hmtl.xslt ?) I thought remove the reference to menu and 
> breadcrumb would be enough. So if I understand well I should create a 
> new template in page2html.xsl ?


Ideally, yes, if you want your design to be different from the 
remaining pages, it would probably be easier to manage to create a new 
XSLT stylesheet and reference it in your pipeline you created.  You can 
do a simple copy of the page2xhtml.xsl file as your starting point, but 
the options for changing styling is endless, really.  Anyway, give it a 
go on the new stylesheet and see what you come up with.

Jon


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


Re: Modify the layout

Posted by laurent <la...@videotron.ca>.
> Have you removed the xsl:apply-templates tags for breadcrumb and menu in 
> the XSLT stylesheet you are referencing in your pipeline above?

Hi Jon,

Thanks for your response.

Humm, no, I didn't remove the xsl:apply-templates tags (in 
page2hmtl.xslt ?) I thought remove the reference to menu and breadcrumb 
would be enough. So if I understand well I should create a new template 
in page2html.xsl ?

Thanks
Laurent

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


Re: Modify the layout

Posted by Jonathan Linczak <li...@hiram.edu>.
On Aug 13, 2004, at 11:23 AM, laurent wrote:

> Hi all,
>
> I'm completely new to lenya (and cocoon), I read many documentations 
> these last days but it remains still much of confused things for me...
> I'm trying to modify the layout of my index_* pages. I don't want to 
> see the menu and breadcrumb in the home page.
> For that, I added in the myPub/publication-sitemap.xmap file a new 
> pipeline like that :
>
> <map:pipeline>
> <!-- /lenyabody-{rendertype}/{publication-id}/{area}/{doctype}/{url} 
> -->
>  <map:match pattern="lenyabody-*/*/*/*/index*">
>  <map:aggregate element="cmsbody">
>  <map:part src="cocoon://navigation/{2}/{3}/tabs/{5}.xml"/>
>  <map:part src="cocoon://navigation/{2}/{3}/search/{5}.xml"/>
> ...
> </map:pipeline>
>
> I just copy the pipeline that builds the page and deleted the 
> reference to menu and breadcrumb and put a pattern for index pages. 
> However, nothing changed in my home page. What's wrong ? Is there a 
> better way to do what I want ?
> Help would be very appreciated.

Have you removed the xsl:apply-templates tags for breadcrumb and menu 
in the XSLT stylesheet you are referencing in your pipeline above?

Jon


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


Re: Modify the layout

Posted by Torsten Schlabach <TS...@gmx.net>.
Hi!

I think this should answer some of your questions:

http://wiki.apache.org/cocoon-lenya/ApplicationLookandFeelHowto

Have a look at the Wiki start page at

http://wiki.apache.org/cocoon-lenya

in general. The Information there is not very well organized, but there is a
lot. Mostly written by people who have gone through the same you do
currently.

Torsten


> Hi all,
> 
> I'm completely new to lenya (and cocoon), I read many documentations 
> these last days but it remains still much of confused things for me...
> I'm trying to modify the layout of my index_* pages. I don't want to see 
> the menu and breadcrumb in the home page.
> For that, I added in the myPub/publication-sitemap.xmap file a new 
> pipeline like that :
> 
> <map:pipeline>
> <!-- /lenyabody-{rendertype}/{publication-id}/{area}/{doctype}/{url} -->
>   <map:match pattern="lenyabody-*/*/*/*/index*">
>   <map:aggregate element="cmsbody">
>   <map:part src="cocoon://navigation/{2}/{3}/tabs/{5}.xml"/>
>   <map:part src="cocoon://navigation/{2}/{3}/search/{5}.xml"/>
> ...
> </map:pipeline>
> 
> I just copy the pipeline that builds the page and deleted the reference 
> to menu and breadcrumb and put a pattern for index pages. However, 
> nothing changed in my home page. What's wrong ? Is there a better way to 
> do what I want ?
> Help would be very appreciated.
> 
> Thanks for all.
> Laurent
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lenya-user-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: lenya-user-help@cocoon.apache.org
> 


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