Bug 45992 - [News module] Error page in Lenya 2.0.2
Summary: [News module] Error page in Lenya 2.0.2
Status: NEW
Alias: None
Product: Lenya
Classification: Unclassified
Component: Miscellaneous (show other bugs)
Version: 2.0
Hardware: PC Linux
: P2 normal
Target Milestone: 2.0.1
Assignee: Lenya Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-12 08:42 UTC by Florent ANDRE
Modified: 2008-10-12 08:43 UTC (History)
0 users



Attachments
The flow input of the collection2xhtml (4.82 KB, text/plain)
2008-10-12 08:43 UTC, Florent ANDRE
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Florent ANDRE 2008-10-12 08:42:17 UTC
I have an error with the display of subnews. 

I want to create this architecture : 
- parent news folder (eg : "all news") 
-- child news folder 1 (eg : "Financial news") 
--- news item 1 
--- news item 2 
-- child news folder 2 (eg : "Motor news") 

If child news don't have news item inside (xhtml document), a clic on the "parent news folder" ("all news") fired an error. 


I found a solution with this two modifications  

1--------- news module : sitemap.xmap--------------------
In the :
 <map:match pattern="feedContent/news/*/*/*/*/*">
__
After : 
<map:transform src="fallback://lenya/modules/news/xslt/includeSubNews.xsl">
          <map:parameter name="pub" value="{2}"/>
          <map:parameter name="area" value="{3}"/>
          <map:parameter name="format" value="{1}"/>
        </map:transform>
        <map:transform type="include"/>
__
Add:
 <map:transform src="fallback://lenya/modules/collection/xslt/prepareInclude.xsl">
          <map:parameter name="pub" value="{2}"/>
          <map:parameter name="area" value="{3}"/>
          <map:parameter name="uuid" value="{4}"/>
          <map:parameter name="language" value="{5}"/>
          <map:parameter name="format" value="{1}"/>
        </map:transform>
        <map:transform type="include"/>

<map:transform src="fallback://lenya/modules/news/xslt/includeSubNews.xsl">
          <map:parameter name="pub" value="{2}"/>
          <map:parameter name="area" value="{3}"/>
          <map:parameter name="format" value="{1}"/>
        </map:transform>
        <map:transform type="include"/>

2 --------------- news module : /xslt/collection2xhtml.xsl ---------
IN : 
<xsl:template match="col:document">
__
Comment : 
      <xsl:apply-templates select="xhtml:html/xhtml:body//xhtml:p[1]" mode="excerpt"/>
__
ADD after the comment : 
        <xsl:apply-templates select="xhtml:html/xhtml:body//xhtml:div[@class='newsItem']"/>
__
ADD this new template : 
      <xsl:template match="xhtml:div[@class='newsItem']">
                <div id="body">
                        <xsl:apply-templates select="@*|node()"/>
<!-- this is another solution, display are similars
                <xsl:copy-of select="xhtml:h2"/>
-->
                </div>
        </xsl:template>

========== Note and problem =======
Note : 

* The <div id="body"> in the <xsl:template match="xhtml:div[@class='newsItem']"> is just for have an indent display. Another id, to define in the CSS, have to put here.

Problem : 

* I don't find the solution for display for each post the first $maxword of the first paragraph.

Attachment : 
BeforeCollection2-XX-XX.xml : the input flow of collection2xhtml.xsl.
Comment 1 Florent ANDRE 2008-10-12 08:43:58 UTC
Created attachment 22714 [details]
The flow input of the collection2xhtml