Форуми / Cotonti / Extensions / Parsing HTML in custom module question

Trustmaster
#32940 26.01.2012 06:02

If the problem is that it shows you page source after you submit it, it might be because of 2 things.

First, make sure you allow HTML upon variable import, so use HTM filter instead of TXT:

$form['jobs_info'] = cot_import('jobs_info', 'P', 'HTM');

Then, make sure you don't apply htmlspecialchars to it. So the output is something like this:

'MY_TEXT' => cot_parse($form['jobs_info']),

About the editor selection question, that is done by site administrator, not by user. Administrator picks a default parser and associates an editor with it. It is Cotonti's duty then to display that editor in modules. You can use a different parser in your module though, that is achieved by setting $sys['parser'] variable and passing it as a 3rd parameter to cot_parse().

May the Source be with you!

Відредаговано: Trustmaster (26.01.2012 06:34, 12 років тому)