欧美三区_成人在线免费观看视频_欧美极品少妇xxxxⅹ免费视频_a级毛片免费播放_鲁一鲁中文字幕久久_亚洲一级特黄

Liferay Portal學習筆記(三):自定義頁面布局

系統 1698 0
?????? Liferay Portal 4.0 為我們提供了幾種不同的頁面布局,我們可以通過 Add Content 中的 Template 參數來指定不同的頁面布局,但是,但我們利用 CMS 來定制文章內容的時候,僅有的幾種頁面布局并不能滿足我們的需求,所以我們需要開發能夠滿足特定需求的頁面布局。
??? 我們將開發一個具有下圖風格的頁面布局,該布局中我們指定了 7 個區域來分別裝配 portlet 實現獨特的頁面風格。
1.JPG
一、編寫模板文件
??? 我們將該頁面風格名稱定義為 1_2_3_2 Columns ,在 Liferay/html/layouttpl/custom 目錄下新建 1_2_3_2_columns.tpl 文件,內容如下:
< 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 >

??? 文件中前三行定義的

和最后三行
是固定的模板格式,從第四行開始就是我們需要定制的頁面風格的 HTML 格式,我們需要將輸出 portlet 區域的 HTML 語句用 $processor.processColumn("column-1") 來替換,“ column-1 ”是該區域的名稱,并且每個區域的名字不能重復,這樣系統在生成模板的時候會自動生成不同的區域來存放我們指定的 portlet

二、編寫屬性文件

??? 我們需要在 liferay-layout-templates.xml 文件中配置我們自定義的頁面布局文件 1_2_3_2_columns.tpl ,為了和系統自帶的布局文件區分開,我們創建擴展文件 liferay-layout-templates-ext.xml ,在該文件中指定我們的頁面布局文件,當然也可以在 liferay-layout-templates.xml 文件直接增加定義。

<o:p> ? </o:p>

liferay-layout-templates-ext.xml

xml?version = " 1.0 " ?>
<!----> DOCTYPE?layout - templates?PUBLIC? " -//Liferay//DTD?Layout?Templates?4.0.0//EN " ? " http://www.liferay.com/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 >

參數 id 定義該 template ID 號, name 定義該 template Add Content 中顯示的名稱, template-path 定義該 template 的路徑名。


三、定制頁面
????定制好頁面風格后,需要重新啟動 TOMCAT ,登陸系統,進入 GUEST 頻道,點擊 Add Content ,在 Template 中將會顯示我們自定義的頁面布局名稱 <st1:chsdate w:st="on" isrocdate="False" islunardate="False" day="3" month="2" year="2001"> 1-2-3 </st1:chsdate> -2 Columns ,選擇該 Template ,然后在頁面中添加 Journal Content ,按照我們自定義的布局將 portlet 拖拉到合適的位置,再為每個 Journal Content 指定 Article ,最后就完成了各種風格頁面的定制過程。使用這個的方法,我們可以定制各種滿足不同需求的頁面。

Liferay Portal學習筆記(三):自定義頁面布局Template


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 日本粉嫩一区二区三区视频 | 超级碰碰碰视频在线观看 | 一个色综合网站 | 久久国产精品一区 | 91九色国产视频 | 国产九色在线 | 精品二区 | 国产精品国产精品 | 中国明星一级毛片免费 | 久久91久久91精品免费观看 | 国产在线小视频 | 亚洲综合色视频在线观看 | 亚洲精品欧美综合四区 | 久久只有这里有精品 | 超级碰碰碰视频视频在线视频 | 日本高清色本在线www | 久久综合九色综合国产 | 国产精品午夜小视频观看 | 深夜福利软件 | 国产成人91高清精品免费 | heyzo欧美| 色吊妞 | 天天鲁天天爽天天视频 | 九九99久久精品在免费线bt | 免费看黄在线网站 | 国产乱码精品一区二区三区中文 | 一区二区成人 | 成人嫩草影院免费观看 | 亚洲国产日本 | 久久er热在这里只有精品85 | 国产成人精品一区二区三在线观看 | 国产一级免费不卡 | 91精品天美精东蜜桃传媒入口 | 国产精品91久久久久久 | 成人a网 | 谍影在线观看电视剧完整版 | 日韩有码第一页 | 日韩欧美小视频 | 成人久久18免费观看 | av资源中文在线 | 免费看一级视频 |