2011-11-09 41 views
1

RTE的默認設置僅允許某些類型的HTML元素。我還想允許TYPO3:允許HTML用於富文本編輯器

  • form
  • button
  • input

我怎樣才能做到這一點?我搜索了一下,發現這樣的:

## RTE configuration 
RTE.default { 
    proc { 
     # tags allowed 
     allowTags = table, tbody, tr, th, td, h1, h2, h3, h4, h5, h6, div, p, br, span, ul, ol, li, re, blockquote, strong, em, b, i, u, sub, sup, strike, a, img, nobr, hr, tt, q, cite, abbr, acronym, center 

     # html parser configuration 
     HTMLparser_rte { 

      # tags allowed 
      allowTags < RTE.default.proc.allowTags 
     } 
    } 
} 

但我不知道這是否是正確的解決方案......

+0

我想這並沒有工作... – testing

回答

0

是。 Alos您應該取消設置拒絕標籤並檢查條目HTMLparser_db子值

可以找到默認RTE配置的示例here

+0

如果我使用'denyTags>'所有denyTags將被重寫?我想保留標準設置,但只允許窗體,按鈕,輸入。 – testing

+0

@測試addToList的反義詞是removeFromList。你可以使用它與denyTags – HerrSerker

+0

@testing你可以重新定義denyTags,它的編輯默認值 –

2

你應該你想要的標籤添加到配置

## RTE configuration 
RTE.default { 
    proc { 
     # tags allowed 
     allowTags = table, tbody, tr, th, td, h1, h2, h3, h4, h5, h6, div, p, br, span, ul, ol, li, re, blockquote, strong, em, b, i, u, sub, sup, strike, a, img, nobr, hr, tt, q, cite, abbr, acronym, center 

     allowTags := addToList(form, button, input) 

     # html parser configuration 
     HTMLparser_rte { 

      # tags allowed 
      allowTags < RTE.default.proc.allowTags 
     } 
    } 
} 
+0

我試過你的代碼,但它輸出前端的html代碼... – testing

+0

你把這段代碼粘貼到PageTS裏面了嗎? – HerrSerker

1

@HerrSerker的答案几乎是正確的 - 它增加了額外的支持標籤(形式,按鈕,輸入)到RTE,但你也需要讓他們在你的FE,所以最終的結果應該是這樣的:

頁TS

RTE.default.proc.allowTags := addToList(form, button, input) 
RTE.default.proc.entryHTMLparser_db.allowTags < RTE.default.proc.allowTags 
RTE.default.proc.allowTagsOutside := addToList(form) 

allowTagsOdside指示RTE允許此標籤在p標籤之外。

TS常量在TS模板

styles.content.links.allowTags := addToList(form, button, input)