Question

I am using TinyMCE for rich text editing of a column which I want to show on the Symfony's admin generator 'List' view.

However when I include this column, the escaped HTML is shown, rather than rendered.

Is there any way to tell the admin generator to use getRaw() for this one column, instead of turning off output escaping for the entire backend app?

Was it helpful?

Solution

It is not possible to do in the current admin generator - you need to duplicate the partial and make a manual change.

OTHER TIPS

You should try using this sentence when outputing something that should be rendered:

<?php echo sfOutputEscaper::unescape($whatever_you_like_to_be_rendered) ?>

This way you use the unsecape in a case by case basis.

I solved this problem when I created my own admin theme. I added an html_whitelist setting to the generator.yml that takes an array of field names and exempts them from any output escaping. I believe I also had modified the partial that outputs these fields (_list_td_tabular perhaps) so 'listen' to the whitelist. I wouldn't recommend this solution if you're using the default Symfony admin generator (b/c you'd have to modify internal code), but if you're using a custom admin theme, go for it! ;)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top