2020国产成人精品视频,性做久久久久久久久,亚洲国产成人久久综合一区,亚洲影院天堂中文av色

分享

【原創(chuàng)】Liferay Portal學(xué)習(xí)筆記(三):自定義頁(yè)面布局Template - 冷...

 nbtymm 2006-12-13
      Liferay Portal 4.0 為我們提供了幾種不同的頁(yè)面布局,我們可以通過(guò) Add Content 中的 Template 參數(shù)來(lái)指定不同的頁(yè)面布局,但是,但我們利用 CMS 來(lái)定制文章內(nèi)容的時(shí)候,僅有的幾種頁(yè)面布局并不能滿(mǎn)足我們的需求,所以我們需要開(kāi)發(fā)能夠滿(mǎn)足特定需求的頁(yè)面布局。
    我們將開(kāi)發(fā)一個(gè)具有下圖風(fēng)格的頁(yè)面布局,該布局中我們指定了7個(gè)區(qū)域來(lái)分別裝配portlet實(shí)現(xiàn)獨(dú)特的頁(yè)面風(fēng)格。
1.JPG
一、編寫(xiě)模板文件
    我們將該頁(yè)面風(fēng)格名稱(chēng)定義為1_2_3_2 Columns,在Liferay/html/layouttpl/custom目錄下新建1_2_3_2_columns.tpl文件,內(nèi)容如下:
<div id="layout-content-outer-decoration">
<div id="layout-content-inner-decoration">
    
<div id="layout-content-container">
      
<table border="0" cellpadding="0" cellspacing="0" width="100%">
        
<tr>
          
<td colspan="3" valign="top">
            $processor.processColumn(
"column-1")
          
</td>
        
</tr>
        
<tr>
          
<td width="79%" valign="top">
              
<table border="0" cellpadding="0" cellspacing="0" width="100%">
                
<tr>
                
<td width="26%" valign="top">
                  $processor.processColumn(
"column-2")
                
</td>
<td class="layout-column-spacer" width="1%">
                    
<div>&nbsp;</div>
                  
</td>
                
<td width="26%" valign="top">
                  $processor.processColumn(
"column-3")
                
</td>
                  
<td class="layout-column-spacer" width="1%">
                    
<div>&nbsp;</div>
                  
</td>
                
<td width="26%" valign="top">
                  $processor.processColumn(
"column-4")
                
</td>
                
</tr>
              
</table>
            
</td>
          
<td class="layout-column-spacer" width="1%">
            
<div>&nbsp;</div>
          
</td>
          
<td width="20%" rowspan="2" valign="top">
            $processor.processColumn(
"column-5")
          
</td>
        
</tr>
        
<tr>
          
<td colspan="2">
            
<table border="0" cellpadding="0" cellspacing="0" width="100%">
              
<tr>
                
<td width="50%" valign="top">
                  $processor.processColumn(
"column-6")
                
</td>
                
<td width="50%" valign="top">
                  $processor.processColumn(
"column-7")
                
</td>
              
</tr>
            
</table>
            
</td>
        
</tr>
      
</table>
    
</div>
</div>
</div>

    文件中前三行定義的 <div> 和最后三行 </div> 是固定的模板格式,從第四行開(kāi)始就是我們需要定制的頁(yè)面風(fēng)格的 HTML 格式,我們需要將輸出 portlet 區(qū)域的 HTML 語(yǔ)句用 $processor.processColumn("column-1") 來(lái)替換,“ column-1 ”是該區(qū)域的名稱(chēng),并且每個(gè)區(qū)域的名字不能重復(fù),這樣系統(tǒng)在生成模板的時(shí)候會(huì)自動(dòng)生成不同的區(qū)域來(lái)存放我們指定的 portlet 。

二、編寫(xiě)屬性文件

    我們需要在 liferay-layout-templates.xml 文件中配置我們自定義的頁(yè)面布局文件 1_2_3_2_columns.tpl ,為了和系統(tǒng)自帶的布局文件區(qū)分開(kāi),我們創(chuàng)建擴(kuò)展文件 liferay-layout-templates-ext.xml ,在該文件中指定我們的頁(yè)面布局文件,當(dāng)然也可以在 liferay-layout-templates.xml 文件直接增加定義。

 

liferay-layout-templates-ext.xml

<? xml version = " 1.0 " ?>
<! DOCTYPE layout - templates PUBLIC  " -//Liferay//DTD Layout Templates 4.0.0//EN "   " http://www./dtd/liferay-layout-templates_4_0_0.dtd " >

< layout - templates >
    
< custom >
        
< layout - template id = " 1_2_3_2_columns "  name = " 1-2-3-2 Columns " >
            
< template - path >/ html / layouttpl / custom / 1_2_3_2_columns.tpl </ template - path >
        
</ layout - template >
    
</ custom >
</ layout - templates >

參數(shù) id 定義該 template ID 號(hào), name 定義該 template Add Content 中顯示的名稱(chēng), template-path 定義該 template 的路徑名。


三、定制頁(yè)面
    定制好頁(yè)面風(fēng)格后,需要重新啟動(dòng)TOMCAT,登陸系統(tǒng),進(jìn)入GUEST頻道,點(diǎn)擊Add Content ,在Template中將會(huì)顯示我們自定義的頁(yè)面布局名稱(chēng)1-2-3-2 Columns,選擇該Template,然后在頁(yè)面中添加Journal Content,按照我們自定義的布局將portlet拖拉到合適的位置,再為每個(gè)Journal Content指定Article,最后就完成了各種風(fēng)格頁(yè)面的定制過(guò)程。使用這個(gè)的方法,我們可以定制各種滿(mǎn)足不同需求的頁(yè)面

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶(hù)發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買(mǎi)等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶(hù) 評(píng)論公約

    類(lèi)似文章 更多