2012/03/16

Fix Content Lead Image Display

collective.contentleadimage 可以為 Plone Content Type 新增一個 lead image 欄位,上傳圖檔來改善內容項目的顯示效果。不過,在管理編輯的 Content 頁籤裡,lead image 還是會顯示出來,這就造成畫面的困擾。

在處理顯示工作的 page template 裡,像是 collective.contentleadimage/borwser/leadimage-body.pt 檔案,加上 not context.REQUEST['URL'].endswith('folder_contents') 的判斷式,應該有助改善這問題。

這樣的撇步也可以應用到 dropdown menu 場面,如果有某個目錄不想在下拉選單裡出現,可以加上判斷式:

<a tal:condition="python: not (item_url.endswith('my_folder/sub_folder') or item_url.endswith('my_folder/another_folder'))"

No comments: