OW2 Consortium
Search OW2 Mail Archive: 

Advanced Search - Powered by Google


Mail Archive Home | exoplatform List | August 2006 Index

<--  Date Index  --> <--  Thread Index  -->

Re: [exoplatform] ecm Content browser. Listing news


The exo:article is just a sample to be adapted by integrators/users as you did

Hence we can not provide in the generic list that also display non exo:article documents and contents some info as if all of those were articles.

HTH

On Aug 23, 2006, at 9:30 AM, Luca Bernardini wrote:

I tried the ecm content browser for listing some news (exo:article). I found this list very poor and printing only two information:
  1. the document name
  2. the document owner
I have improved this list inserting also the title, the summary and the image icon (thank you to "hoapham" for suggestion).
If someone wants to take a look, I provide this code in attachment.
Copy & Paste the content in
Ecm administration > Manage View > CBTemplates > PathList

Ciao. Luca+ (italy)

#set( $targetPage = "" )
#set( $targetComponent = "" )
#if( $uicomponent.getTargetPage() )
#set( $targetPage = $uicomponent.getTargetPage() )
#end
#if( $uicomponent.getTargetComponent() )
#set( $targetComponent = $uicomponent.getTargetComponent() )
#end




#macro(renderDocument $node)


<div style="padding: 10px; background: rgb(248, 248, 248)" class="decorator article">
#if($uicomponent.hasDocuments())
#foreach($document in $uicomponent.getDocumentPageList())


#set($result=$velocityCount%2)
#if($result==1)
#set( $oddeven = "odd" )


#else
#set( $oddeven = "even" )
#end


<div class="$oddeven">


#set( $nodo = $document.getNode() )



<!-- setting a default node creation date -->
#set( $dataora = "" )
#if( $nodo.hasProperty("jcr:created") )
<!-- dovrei fare getDate ma dopo non so come formattarla -->
#set( $dataora = $nodo.getProperty("jcr:created").getString() )
#end


#if( $nodo.isNodeType( "exo:article" ) )
#set($title = $nodo.getProperty("exo:title").getString() )


#if( $nodo.hasProperty("exo:date") )
<!-- dovrei fare getDate ma dopo non so come formattarla -->
#set( $dataora = $nodo.getProperty("exo:date").getString() )
#end
#if( $nodo.hasProperty("exo:datetime") )
#set( $dataora = $nodo.getProperty("exo:datetime").getString() )
#end


#else
#set( $title = $document.getName() )
#end



<span class="title-article" >


#res("UIContentList.icon.content-article")
#if($targetComponent.equals(""))
#jsfLink($title $uicomponent.getViewDocumentParams() $document.getUri())
#else
#jsfCrossLink($title $uicomponent.getViewDocumentParams() $document.getUri() $targetComponent $targetPage)
#end
</span>



#if( $nodo.isNodeType( "exo:article" ) )
<div style="margin-top: 3px;">



<!-- @@SOSP BLUCA occorre testare se l'immagine non esiste. In tal 
    caso, visualizzare una immagine fissa decente.
-->

<img src="" style="border: none; float: left;" width="80" height="50" alt="$document.getName()" />



<span class="title-bg">
<label class="text" style="padding-left: 5px">Sommario:</label>
</span>


<div style="padding-left: 5px;" class="summary">
$nodo.getProperty("exo:summary").getString()
</div>


</div>
#end



<div style="margin-left: 28px; margin-top: 3px;" class="info" >


<span style="margin-right: 30px;">
#res("UIContentList.label.article-author")
$uicomponent.getDocumentOwner($document)
</span>


<span style="margin-right: 30px;">
<label class="text">Date: </label>
$dataora
</span>


</div>



</div>   <!-- chiude odd/even -->
#end


<div style="text-align: right">
#jsfRenderChild("UIPageListIterator")
</div>
#else
<div style="text-align:center"> #res("UIContentList.label.no-article") </div>
#end
</div>
#end






#set($rootPath = $uicomponent.getRootPath())
<div class="UIContentList">  
<div style="padding-left: 10px;">
<div style="padding: 2px;" class="path">
<div style="padding-top: 5px">
#jsfLink("@UIContentList.button.home" $uicomponent.getChangeNodeParams() $rootPath)
#set($selectPath = $rootPath)
#foreach($localPath  in $uicomponent.getSelectedNodePath())


#set($selectPath = "${selectPath}/${localPath}")
#res("UIContentList.icon.arrow-tiny")
#if($localPath=="null")                
#jsfLink($localPath $uicomponent.getChangeNodeParams() $selectPath)
#elseif(($localPath!="null")&&($localPath.length()<20))
#jsfLink($localPath $uicomponent.getChangeNodeParams() $selectPath)
#else
#set($subPath="${localPath.substring(0,15)}...")
<span title="${localPath}">#jsfLink($subPath $uicomponent.getChangeNodeParams() $selectPath)</span>
#end
#end
</div>
</div>    
</div>


<div style="margin: 5px; padding: 0px 10px 10px;background: rgb(238, 239, 243)" class="decorator">   
<div class="title" >
#res("UIContentList.icon.categories")
#res("UIContentList.label.category")
</div>


<div style="margin: 10px 0px; background: rgb(248, 248, 248)" class="decorator">
<div style="margin:auto width: 80%; text-align: left">
#foreach($list in $uicomponent.getSiblingCategories())


<div style="margin: 15px 100px" class="list">
<div style="overflow: hidden; width: 100%">
#foreach($node in $list)



#set($name=$node.getName())


<div style="float: left; width: 30%">
#res("UIContentList.icon.content-arrow")
#if($name.length()<20)
#jsfLink($node.getName() $uicomponent.getViewCategoryParams() $node.getPath())
#else
#set($subName="${name.substring(0,15)}...")
<span title="${name}">
#jsfLink($subName $uicomponent.getViewCategoryParams() $node.getPath())
</span>
#end
</div>
#end 
</div>
</div>
#end
</div>
</div>


#if($uicomponent.isRootCategory())
#set($parent=$uicomponent.getNode())
#renderDocument($parent)
#else



<div style="overflow: hidden; width: 100%">
#set($node=$uicomponent.getNode())
<div style="background:url('/cms-content/images/small/monitor.gif') no-repeat ;float: left; height: 19px; width: 19px; margin-left: 10px"></div>
<div style="background:url('/cms-content/images/small/category-tab-left.gif') no-repeat ;float: left; width: 4px; height: 19px; margin-left: 10px"></div>
<div style="background:url('/cms-content/images/small/category-tab-center.gif') repeat-x ;padding: 0px 10px; float: left;" class="title-sub-content">
#set($name=$node.getName())
#if($name.length()<20)
$name
#else
#set($subName="${name.substring(0,15)}...")
<span title="${name}">$subName</span>
#end
</div> 
<div style="background:url('/cms-content/images/small/category-tab-right.gif') no-repeat ; float:left; width: 17px; height: 19px">
</div>
</div>            
<div style="background: url('/cms-content/images/small/category-submenu.gif') repeat-x">
<div style="overflow: hidden; width: 100%">
<div style="background: url('/cms-content/images/small/category-submenu-left.gif') no-repeat ; float: left; height: 23px; width: 5px"></div>
<div style="background: url('/cms-content/images/small/category-submenu-right.gif') no-repeat ; float: right; height: 23px;width: 5px"></div>
<div style="margin:0px 5px">
#if($uicomponent.hasChildren())


<div style="overflow: hidden; width: 100%">
#foreach($node in $uicomponent.getChildCategories($node))
<div style="float: left; padding: 5px 10px" class="sub-content-list">
#set($name=$node.getName())
#if($name.length()<20)
#jsfLink($name $uicomponent.getViewCategoryParams() $node.getPath())
#else
#set($subName="${name.substring(0,15)}...")
<span title="${name}">
#jsfLink($subName $uicomponent.getViewCategoryParams() $node.getPath())
</span>
#end
</div>  
#end
</div>
#end
</div>
</div>
</div>
#renderDocument($node)
#end
</div>
</div>
<luca.bernardini.vcf>

--
You receive this message as a subscriber of the exoplatform@xxxxxxxxxxxxx mailing list.
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws



<--  Date Index  --> <--  Thread Index  -->

Reply via email to:

Powered by MHonArc.

Copyright © 2006-2007, OW2 Consortium | contact | webmaster.