2017-03-20 20 views
2

我目前在我的AEM 6.2項目中使用富文本編輯器(RTE)。我想配置RTE使用blockquote標籤。如何實現這一目標?更新RTE組件以在AEM中使用塊引用

<blockquote> 

組件的代碼:

<paraformat jcr:primaryType="nt:unstructured" features="*"> 
    <formats jcr:primaryType="cq:WidgetCollection"> 
     <p jcr:primaryType="nt:unstructured" description="Paragraph" tag="p"/> 
     <h1 jcr:primaryType="nt:unstructured" description="Heading 1" tag="h1"/> 
     <h2 jcr:primaryType="nt:unstructured" description="Heading 2" tag="h2"/> 
     <h3 jcr:primaryType="nt:unstructured" description="Heading 3" tag="h3"/> 
     <h4 jcr:primaryType="nt:unstructured" description="Heading 4" tag="h4"/> 
     <h5 jcr:primaryType="nt:unstructured" description="Heading 5" tag="h5"/> 
     <blockquote jcr:primaryType="nt:unstructured" description="Block Quote" tag="blockquote"/> 
    </formats> 
</paraformat> 

參考:

RTE in JCR

Dialog View

感謝。

+0

* configure *是什麼意思?你是否希望RTE顯示'blockquote'作爲選項,還是希望它允許'blockquote'被渲染?這是兩個不同的問題,因此要求。 –

+0

我的意思是讓RTE使用'blockquote'。 – phemanthkumar28

+0

請參閱下面的答案。我已經涵蓋了這兩個問題。讓我知道如果你需要更多的細節 –

回答

2

您可以通過以下官方在文檔中的說明添加一個新的塊級元素:

Adding custom paragraph formats to RTE

基本上,你疊加RTE並通過引入新的元素延伸paraformat插件。摘要步驟是:

  1. 疊加您的RTE
  2. 創建CQ:您的RTE控制下EditConfig/inplaceEditing/paraformat /格式節點。
  3. 創建你的風格的一個節點,將其命名,並給它的以下屬性 - >Description: Block Quote & Tag: blockquote
  4. 請務必添加所有其他默認格式,如P,H1,H2等

這它。您應該可以在段落樣式下拉菜單中看到新的段落樣式。

這是因爲所有的圖片將讓這個帖子太長時間,但詳細的崗位,可以發現在內容摘要:http://www.aemcq5tutorials.com/tutorials/configure-rte-plugin-in-touch-ui/

可選,您需要檢查是否BLOCKQUOTE元素通過檢查允許您的/libs/cq/xssprotection/config.xml文件。該文件是自解釋性的,有很多評論,但一般來說,您應該檢查<tag-rules>以確保您的代碼得到支持。 OOTB AEM 6.2允許元素,但某些升級可能已經丟失。

+0

真棒!有效!!謝謝!! 關於'config.xml'的最後一步很好理解。 – phemanthkumar28

+0

很高興工作。在您更新後可能會出錯,我正在撓頭。如果你願意,接受答案。這可能有助於其他人。特別是對於升級後遺留的配置而言,config.xml非常痛苦。 –