{"id":400,"date":"2011-08-19T11:25:35","date_gmt":"2011-08-19T11:25:35","guid":{"rendered":"https:\/\/www.taywa.ch\/blog\/?p=400"},"modified":"2011-09-12T09:16:46","modified_gmt":"2011-09-12T09:16:46","slug":"rte-links-eigene-typo3-extension-bestehendes-feld-rte-erweitern","status":"publish","type":"post","link":"https:\/\/www.taywa.ch\/blog\/typo3\/typoscript\/rte-links-eigene-typo3-extension-bestehendes-feld-rte-erweitern\/","title":{"rendered":"RTE mit Links in eigener Typo3 Extension &mdash; RTE zu bestehendem (tt_news) Feld hinzuf\u00fcgen"},"content":{"rendered":"<p>problemfleder: input feld\/textarea hat kein RTE &#8211; links werden in der DB mit &lt;a&gt; und nicht mit &lt;link&gt; abgespeichert &#8211; email links aus eigenen RTE feldern werden nicht encrypted &#8211; tt_news_cat description mit RTE<\/p>\n<p>in der ext_tables.php der typo3 extension bei dem gew\u00fcnschten feld (oder in einer neuen mini-extension f\u00fcr ein bestehendes feld) die Eigenschaft &#8218;defaultExtras&#8216; hinzuf\u00fcgen:<\/p>\n<div class=\"php dean_ch\"><span class=\"st_h\">&#8218;$tempColumns = array (<br \/>\n&nbsp; &nbsp; description&#8216;<\/span> <span class=\"sy0\">=&gt;<\/span> <a href=\"http:\/\/www.php.net\/array\"><span class=\"kw3\">array<\/span><\/a><span class=\"br0\">&#40;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"st_h\">&#8218;exclude&#8216;<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"st_h\">&#8218;1&#8216;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"st_h\">&#8218;label&#8216;<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"st_h\">&#8218;LLL:EXT:lang\/locallang_general.xml:LGL.description&#8216;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"st_h\">&#8218;config&#8216;<\/span> <span class=\"sy0\">=&gt;<\/span> <a href=\"http:\/\/www.php.net\/array\"><span class=\"kw3\">array<\/span><\/a><span class=\"br0\">&#40;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"st_h\">&#8218;type&#8216;<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"st_h\">&#8218;text&#8216;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"st_h\">&#8218;cols&#8216;<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"st_h\">&#8217;45&#8216;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"st_h\">&#8218;rows&#8216;<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"st_h\">&#8218;5&#8216;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#41;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class=\"st_h\">&#8218;defaultExtras&#8216;<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"st_h\">&#8218;richtext[bold|unorderedlist|link]:rte_transform[mode=ts_css]&#8216;<\/span><br \/>\n<span class=\"co2\">#<br \/>\n<\/span><span class=\"co2\"># richtext[bold|unorderedlist|link]<br \/>\n<\/span><span class=\"co2\"># definiert die verf\u00fcgbaren formatierungsoptionen<br \/>\n<\/span><span class=\"co2\">#<br \/>\n<\/span><span class=\"co2\"># rte_transform[mode=ts_css]<br \/>\n<\/span><span class=\"co2\"># wandelt &lt;a&gt; tags in &lt;link&gt; tags um und wrapt abs\u00e4tze in &lt;p&gt; tags<br \/>\n<\/span><span class=\"co2\"># dies kann auch weggelassen werden, wenn nur<br \/>\n<\/span><span class=\"co2\"># formatierungen (ul\/ol\/b\/&#8230;) gebraucht werden <br \/>\n<\/span>&nbsp; &nbsp; <span class=\"br0\">&#41;<\/span><br \/>\n<span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><\/div>\n<p>wurde der rte_transform parameter definiert muss der inhalt f\u00fcr die ausgabe wieder trasformiert werden. in der extension folgendermassen anpassen:<\/p>\n<div class=\"php dean_ch\"><span class=\"co2\">#alt:<br \/>\n<\/span><span class=\"st_h\">&#8218;&lt;div&gt;&#8216;<\/span><span class=\"sy0\">.<\/span> <span class=\"re0\">$row<\/span><span class=\"br0\">&#91;<\/span><span class=\"st_h\">&#8218;description&#8216;<\/span><span class=\"br0\">&#93;<\/span> <span class=\"sy0\">.<\/span><span class=\"st_h\">&#8218;&lt;\/div&gt;&#8216;<\/span><br \/>\n<span class=\"co2\">#neu:<br \/>\n<\/span><span class=\"st_h\">&#8218;&lt;div&gt;&#8216;<\/span><span class=\"sy0\">.<\/span> &nbsp;<span class=\"re0\">$this<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">pi_RTEcssText<\/span><span class=\"br0\">&#40;<\/span> <span class=\"re0\">$row<\/span><span class=\"br0\">&#91;<\/span><span class=\"st_h\">&#8218;description&#8216;<\/span><span class=\"br0\">&#93;<\/span> <span class=\"br0\">&#41;<\/span> <span class=\"sy0\">.<\/span><span class=\"st_h\">&#8218;&lt;\/div&gt;&#8216;<\/span><\/div>\n<p>wird der inhalt direkt im typoscript generiert muss wohl das renderObj des CONTENT elementes mit dem RTE geparsed werden. ungetestet &#8211; in etwa so: <\/p>\n<div class=\"typoscript dean_ch\"><span class=\"re5\">temp<\/span><span class=\"sy0\">.<\/span>categories <span class=\"sy0\">=<\/span> <a href=\"http:\/\/www.typo3.net\/tsref\/cobject\/content\/\"><span class=\"kw4\">CONTENT<\/span><\/a><br \/>\n<span class=\"re5\">temp<\/span><span class=\"sy0\">.<\/span>categories <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; table <span class=\"sy0\">=<\/span> <span class=\"re3\">tt_news_cat<\/span><br \/>\n&nbsp; &nbsp; <a href=\"http:\/\/www.typo3.net\/tsref\/functions\/select\/\"><span class=\"kw2\">select<\/span><\/a> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co2\"># the category folder(s)<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; pidInList <span class=\"sy0\">=<\/span> <span class=\"nu0\">5<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; selectFields <span class=\"sy0\">=<\/span> uid,title,description<br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><\/p>\n<p>&nbsp; &nbsp; renderObj <span class=\"sy0\">=<\/span> <a href=\"http:\/\/www.typo3.net\/tsref\/cobject\/coa\/\"><span class=\"kw4\">COA<\/span><\/a><br \/>\n&nbsp; &nbsp; renderObj <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"nu0\">10<\/span> <span class=\"sy0\">=<\/span> <a href=\"http:\/\/www.typo3.net\/tsref\/cobject\/text\/\"><span class=\"kw4\">TEXT<\/span><\/a><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"nu0\">10<\/span><span class=\"sy0\">.<\/span>field <span class=\"sy0\">=<\/span> title<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"nu0\">20<\/span> <span class=\"sy0\">=<\/span> <a href=\"http:\/\/www.typo3.net\/tsref\/cobject\/text\/\"><span class=\"kw4\">TEXT<\/span><\/a><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"nu0\">20<\/span><span class=\"sy0\">.<\/span>field <span class=\"sy0\">=<\/span> description<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"nu0\">20<\/span><span class=\"sy0\">.<\/span><a href=\"http:\/\/www.typo3.net\/tsref\/functions\/parsefunc\/\"><span class=\"kw2\">parseFunc<\/span><\/a> <span class=\"sy0\">=&lt;<\/span> <span class=\"re5\">lib<\/span><span class=\"sy0\">.<\/span>parseFunc_RTE <br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n<span class=\"br0\">&#125;<\/span> <\/div>\n<p>interessanter snippets zum rendering: http:\/\/www.pi-phi.de\/rendering.html<\/p>\n","protected":false},"excerpt":{"rendered":"<p>problemfleder: input feld\/textarea hat kein RTE &#8211; links werden in der DB mit &lt;a&gt; und nicht mit &lt;link&gt; abgespeichert &#8211; email links aus eigenen RTE feldern werden nicht encrypted &#8211; tt_news_cat description mit RTE in der ext_tables.php der typo3 extension bei dem gew\u00fcnschten feld (oder in einer neuen mini-extension f\u00fcr ein bestehendes feld) die Eigenschaft<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,4],"tags":[90,97,111,63,180,181],"class_list":["post-400","post","type-post","status-publish","format-standard","hentry","category-extension_entwicklung","category-typoscript","tag-extension","tag-exttables-php","tag-rte","tag-tt_news","tag-typo3","tag-typoscript"],"_links":{"self":[{"href":"https:\/\/www.taywa.ch\/blog\/wp-json\/wp\/v2\/posts\/400","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.taywa.ch\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.taywa.ch\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.taywa.ch\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.taywa.ch\/blog\/wp-json\/wp\/v2\/comments?post=400"}],"version-history":[{"count":14,"href":"https:\/\/www.taywa.ch\/blog\/wp-json\/wp\/v2\/posts\/400\/revisions"}],"predecessor-version":[{"id":404,"href":"https:\/\/www.taywa.ch\/blog\/wp-json\/wp\/v2\/posts\/400\/revisions\/404"}],"wp:attachment":[{"href":"https:\/\/www.taywa.ch\/blog\/wp-json\/wp\/v2\/media?parent=400"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.taywa.ch\/blog\/wp-json\/wp\/v2\/categories?post=400"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.taywa.ch\/blog\/wp-json\/wp\/v2\/tags?post=400"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}