[TYPO3-commerce] How to pass RTE config to commerce

Erik Sokoll erik at t3media.de
Wed Apr 28 16:27:03 CEST 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Benny,
modifying commerce_pibase is an ugly thing, but in this case it seems to
be the only way (no hooks around there).
To enable the HTML tags <object>, <param> and <embed> inside the
description field of categories I over wrote the parseFunc in the
conf-array.
By default you find there some default values for 'allowTags', so I
simply added in lib/class.tx_commerce_pibase.php after...

//###CATEGORY_VIEW_DISPLAY###
$templateMarker =
'###'.strtoupper($this->conf['templateMarker.']['categoryView']).'###';

...the lines...

$this->conf['singleView.']['categories.']['fields.']['description.']['parseFunc.']['tags.']['object.']['allowedAttribs']
= 'width, height';
$this->conf['singleView.']['categories.']['fields.']['description.']['parseFunc.']['tags.']['param.']['allowedAttribs']
= 'name, value';
$this->conf['singleView.']['categories.']['fields.']['description.']['parseFunc.']['tags.']['embed.']['allowedAttribs']
= 'src, type, allowscriptaccess, allowfullscreen, width, height';
$this->conf['singleView.']['categories.']['fields.']['description.']['parseFunc.']['allowTags']
=
'b,i,u,a,img,br,div,center,pre,font,hr,sub,sup,p,strong,em,li,ul,ol,blockquote,strike,del,ins,span,h1,h2,h3,h4,h5,h6,address,object,param,embed';

...which are passed as $TS in function generateMarkerArray().

Dirty hack, I know. But unfortunately till now the only way.

Anyhow... in general I think it would be nice if commerce would use the
regular TS-RTEconfig which is defined by an administrator (and not its
own settings).

So is it a bug or is it a feature?!? ;)

Could somebody from the project maybe check static/setup.txt? Probably
there is a smarter way.

Greetings...
Erik


Benny Schimmer schrieb:
> Hi Erik,
> 
> the typoscript option general_stdWrap seems not to be used anywhere in
> commerce as well as in the typo3-core.
> So till now this option does not make any sense at all.
> But it is a common parameter for other extensions like tt_news.
> To make it work alike, you should add the following function to
> commerce_pibase, and put every field of the database which is filled by
> the RTE through it.
> 
> function formatStr($str) {
>   if (is_array($this->conf['general_stdWrap.'])) {
>   $str = $this->cObj->stdWrap($str, $this->conf['general_stdWrap.']);
>   }
>   return $str;
>  }
> 
> If you don't want to add this to the code, simply use a hook, where the
> markers are filled and use the cObj->stdWrap function
> 
> 
> It seems that this option was once planed but never implemented.
> 
> Greetings,
> 
> Benny and Florian
> 
> Am 27.04.2010 17:24, schrieb Erik Sokoll:
> Sorry guys, but meanwhile I drive crazy. I was to fast with the positive
> answer.
> But again the facts: I configured the standard RTE to accept e.g. the
> <object>  HTML tag. It works fine with all RTE-parsers (on the normal
> page)
> Now... after Sascha gave me the hint... the same pageTSconfig is used in
> the root template and the Commerce folders.
> 
> BUT... the only thing which works from now is 'RTE writing to DB' and
> 'reading from DB' in the BackEnd RTE field. In the Frontend<object>
> becomes&lt;object&gt; ...if I want to use it in a commerce product
> description.
> 
> I checked by 'web/info/page-TSconfig' and by default there is:
> <TS>
> RTE.config.tx_commerce_products.description.proc.exitHTMLparser_db.tags.font...
> 
> (etc)
> </TS>
> 
> So I added...
> 
> <TS>
> RTE.config.tx_commerce_products.description.proc.exitHTMLparser_db.tags.object.allowedAttribs
> 
> = width, height
> RTE.config.tx_commerce_products.description.proc.exitHTMLparser_db.allowTags
> 
> =  a, abbr, acro... ...object
> </TS>
> 
> ...for entryHTMLparser_db, exitHTMLparser_db and HTMLparser_db but there
> is no difference.
> 
> Moreover I defined:
> plugin.tx_commerce_pi1.general_stdWrap.parseFunc<  lib.parseFunc_RTE
> 
> ...wich is also used in other places e.g. here:
> tt_content.text.20.parseFunc<  lib.parseFunc_RTE
> 
> 
> And so what?!?
> In tt_content it works but not in commerce FE page!
> 
> 
> *crying*
> 
> Erik
> 
> 
> Erik Sokoll schrieb:
>>>> I can't belief it... you are right!!!
>>>>
>>>> *headbang*
>>>>
>>>> The folders...
>>>>
>>>> Commerce
>>>>    Products
>>>>    Attributes
>>>>    Orders
>>>>
>>>> ...are BESIDE the root page and not inside.
>>>>
>>>> @Sebastian: If you are going to read this, please put it on the list!
>>>>
>>>>
>>>> Greetings...
>>>> Erik
>>>>
>>>>
>>>> Sascha Egerer schrieb:
>>>>> Am 27.04.10 11:15, schrieb Erik Sokoll:
>>>>> Hi people,
>>>>> how can I pass my "normal" RTE (rtehtmlarea) configuration to Commerce
>>>>> to be used in commerce RTE fields?
>>>>
>>>>> Greetings...
>>>>> Erik
>>>>
>>>>> You have to insert your PageTS to the Commerce Folder in the pagetree.
>>>>> _______________________________________________
>>>>> TYPO3-project-commerce mailing list
>>>>> TYPO3-project-commerce at lists.typo3.org
>>>>> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-commerce
>>>>
> _______________________________________________
> TYPO3-project-commerce mailing list
> TYPO3-project-commerce at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-commerce
> 
> 
> 
> 

> _______________________________________________
> TYPO3-project-commerce mailing list
> TYPO3-project-commerce at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-commerce



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFL2EW3uogOZOO2WPQRAgY1AJ4/XCkOBDoOrggEsT7oaUSvaSiK/wCdFCwz
890ETi5Kn4KRrMte/Prn3AA=
=QQti
-----END PGP SIGNATURE-----


More information about the TYPO3-project-commerce mailing list