亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

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

系統(tǒng) 1827 0
?????? Liferay Portal 4.0 為我們提供了幾種不同的頁面布局,我們可以通過 Add Content 中的 Template 參數(shù)來指定不同的頁面布局,但是,但我們利用 CMS 來定制文章內(nèi)容的時候,僅有的幾種頁面布局并不能滿足我們的需求,所以我們需要開發(fā)能夠滿足特定需求的頁面布局。
??? 我們將開發(fā)一個具有下圖風(fēng)格的頁面布局,該布局中我們指定了 7 個區(qū)域來分別裝配 portlet 實(shí)現(xiàn)獨(dú)特的頁面風(fēng)格。
1.JPG
一、編寫模板文件
??? 我們將該頁面風(fē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 >

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

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

二、編寫屬性文件

??? 我們需要在 liferay-layout-templates.xml 文件中配置我們自定義的頁面布局文件 1_2_3_2_columns.tpl ,為了和系統(tǒng)自帶的布局文件區(qū)分開,我們創(chuàng)建擴(kuò)展文件 liferay-layout-templates-ext.xml ,在該文件中指定我們的頁面布局文件,當(dāng)然也可以在 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 >

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


三、定制頁面
????定制好頁面風(fēng)格后,需要重新啟動 TOMCAT ,登陸系統(tǒng),進(jìn)入 GUEST 頻道,點(diǎn)擊 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 ,最后就完成了各種風(fēng)格頁面的定制過程。使用這個的方法,我們可以定制各種滿足不同需求的頁面。

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


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯(lián)系: 360901061

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

【本文對您有幫助就好】

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

發(fā)表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 欧美黄一片 | 久久亚洲热 | 日本中文字幕不卡免费视频 | 久久99热精品免费观看 | 五月天婷婷一区二区三区久久 | 亚洲男人的天堂在线视频 | 香蕉国产人午夜视频在线观看 | 色天使久久综合网天天 | 亚洲久久久久 | 黑丝毛片 | 日韩欧美在线观看视频一区二区 | 中国大陆一级毛片 | 不卡网| 日本欧美一区二区三区乱码 | 国产亚洲午夜精品 | 色五月在线视频 | 免费国产不卡午夜福在线 | 亚洲精品成人456在线播放 | 亚洲人和日本人jzz护士 | 精品视频亚洲 | 热99在线观看 | 亚洲精品伊人久久久久 | 日韩欧美一级毛片视频免费 | 日韩中文字幕视频在线 | 国产精品高清在线观看93 | 97视频在线视频 | 天天干天天干 | 免费观看男女羞羞的视频网站 | 狠狠色丁香婷婷久久综合2021 | 99中文在线 | 国产日本三级 | 免费观看亚洲视频 | 爱爱爱免费视频 | 国产精品乱码高清在线观看 | 国产综合色在线视频播放线视 | 大乳孕妇一级毛片 | 99热久久这里只精品国产ww | 中日韩欧美中文字幕毛片 | 久草免费新视频 | 成熟女人50岁一级毛片不卡 | 国产亚洲精品免费 |