黄色网页视频 I 影音先锋日日狠狠久久 I 秋霞午夜毛片 I 秋霞一二三区 I 国产成人片无码视频 I 国产 精品 自在自线 I av免费观看网站 I 日本精品久久久久中文字幕5 I 91看视频 I 看全色黄大色黄女片18 I 精品不卡一区 I 亚洲最新精品 I 欧美 激情 在线 I 人妻少妇精品久久 I 国产99视频精品免费专区 I 欧美影院 I 欧美精品在欧美一区二区少妇 I av大片网站 I 国产精品黄色片 I 888久久 I 狠狠干最新 I 看看黄色一级片 I 黄色精品久久 I 三级av在线 I 69色综合 I 国产日韩欧美91 I 亚洲精品偷拍 I 激情小说亚洲图片 I 久久国产视频精品 I 国产综合精品一区二区三区 I 色婷婷国产 I 最新成人av在线 I 国产私拍精品 I 日韩成人影音 I 日日夜夜天天综合

Liferay Portal學習筆記(二):使用CMS

系統 1960 0
?????? Liferay Portal CMS(Content Manage System) 提供了兩大功能:文檔管理和文章發布。文檔管理包括文檔庫和圖片集兩個 portlets ,能夠提供對 Microsoft Office 文檔、 PDFs 、文本文件和圖片的管理;文章發布功能依靠 Liferay Portal 中的 Journal portlet 完成,它的特性是能夠將數據( data entry )和版面設計( Layout Design )很輕易的分開,這就使得 content 能夠復合一致的“ look and feel ”,另外, Journal portlet 提供了 content 的版本跟蹤和發布流程的功能。
???

Liferay Portal CMS 功能是通過 Journal Portlet 實現的,在介紹怎樣使用 Journal Portlet 之前,有必要理解 structures 、 templates articles 的概念,它們是 Journal portlet 功能的基礎。

l ???????? Structures :定于了 content 的類型和數量, content 的類型包括 text text area 、 images selection lists

l ???????? Templates :確定 content 怎樣排列或擺放

l ???????? Articles :確定每個 content 包含的實際的 text images

??
??? 我們以下圖為例定義一個
content ,分為三個步驟:
1.JPG

第一步、創建 Structure ,包含一下元素:一個 text 元素名為“ headline ”(對應圖片 1 區域)、三個 text area 元素為名稱分別為“ body-text ”(對應 4 區域)“ caption-1 ”(對應 2 區域)“ caption-2 ”(對應 6 區域)、兩個 image 元素名稱分別為“ image-1 ”(對應 3 區域)和“ image-2 ”(對應 5 區域)

添加完這些元素后的界面如下:
2.JPG

點擊 Launch Editor 按鈕,可以看到 XML 定義,也可以在此增刪或修改元素及類型,內容如下:

< root >
??
< dynamic - element?name = ' headline ' ?type = ' text ' ><!----> dynamic - element >
??
< dynamic - element?name = ' body-text ' ?type = ' text_area ' ><!----> dynamic - element >
??
< dynamic - element?name = ' caption-1 ' ?type = ' text_area ' ><!----> dynamic - element >
??
< dynamic - element?name = ' caption-2 ' ?type = ' text_area ' ><!----> dynamic - element >
??
< dynamic - element?name = ' image-1 ' ?type = ' image ' ><!----> dynamic - element >
??
< dynamic - element?name = ' image-2 ' ?type = ' image ' ><!----> dynamic - element >
<!----> root >

第二步、創建 Template ,添入 ID 、 Name 、 Description 信息后,在 Structure 一欄選擇上一步創建的 Structure (這里為 test
3.JPG

然后點擊 Launch Editor 按鈕,打開 Template 編輯窗口,按照所需要的格式定義 Template ,如下:

xml?version = " 1.0 " ?>

< xsl:stylesheet?xmlns:xsl = " http://www.w3.org/1999/XSL/Transform " ?version = " 1.0 " > ??
??
< xsl:output?method = " html " ?omit - xml - declaration = " yes " /> ??
??
< xsl:template?match = " / " > ?
????
< table?cellpadding = " 0 " ?cellspacing = " 0 " ?border = " 0 " ?width = " 100% " > ?
??????
< tr > ?
????????
< td?colspan = " 2 " >
??????????
< xsl:value - of
?disable
- output - escaping = " yes " ?select = " root/dynamic-element[@name='headline']/dynamic-content " />
????????
<!----> td >
??????
<!----> tr >
??????
< tr >
????????
< td >
??????????
< img > ?
????????????
< xsl:attribute?name = " src " > ?
??????????????
< xsl:value - of?
disable
- output - escaping = " yes " ?select = " root/dynamic-element[@name='image-1']/dynamic-content " /> ?
????????????
<!----> xsl:attribute > ?
??????????
<!----> img >
????????
<!----> td >
????????
< td >
??????????
< xsl:value - of?
disable
- output - escaping = " yes " ?select = " root/dynamic-element[@name='caption-1']/dynamic-content " />
????????
<!----> td >
??????
<!----> tr >
??????
< tr >
????????
< td?colspan = " 2 " >
??????????
< xsl:value - of?
disable
- output - escaping = " yes " ?select = " root/dynamic-element[@name='body-text']/dynamic-content " />
????????
<!----> td >
??????
<!----> tr >
??????
< tr >
????????
< td >
??????????
< xsl:value - of?
disable
- output - escaping = " yes " ?select = " root/dynamic-element[@name='caption-2']/dynamic-content " />
????????
<!----> td >
????????
< td >
??????????
< img > ?
????????????
< xsl:attribute?name = " src " > ?
??????????????
< xsl:value - of?
disable
- output - escaping = " yes " ?select = " root/dynamic-element[@name='image-2']/dynamic-content " /> ?
????????????
<!----> xsl:attribute > ?
??????????
<!----> img >
????????
<!----> td >
??????
<!----> tr >
????
<!----> table > ?
??
<!----> xsl:template > ?
<!----> xsl:stylesheet >

下面對該文件進行說明:

1 、這里的 @name=’ 名稱 必須要和第一步中創建 Structure 中的元素名稱一致,頁面格式根據需求使用 HTML 語言定義即可。

2 、對 text 、 text area 類型的元素輸出時的格式如下:

<xsl:value-of></xsl:value-of>

disable-output-escaping="yes" select="root/dynamic-element[@name='caption-2']/dynamic-content"/>

1、 ? image 類型的元素輸出時的格式如下:

? <xsl:attribute name="src"> </xsl:attribute>

??? <xsl:value-of></xsl:value-of>

disable-output-escaping="yes" select="root/dynamic-element[@name='image-2']/dynamic-content"/>

?

第三步、創建 Article ,添寫基本信息后,在 Structure 一欄選擇 test ,對應的 Template 一欄也選擇 test 即可,然后在對應的元素域里添入合適的文本或者圖片,點擊預覽即可以看到如下界面,確定無問題后,點擊保存或者保存并發布按鈕即可完成 content 的定制。
4.JPG

通過以上三個步驟,我們就實現了定制 content 的功能。使用 Journal Portlet ,我們可以定制任何不同風格的 content 來展示必要的信息。

Liferay Portal學習筆記(二):使用CMS


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

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

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

【本文對您有幫助就好】

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

發表我的評論
最新評論 總共0條評論