Reputation: 4072
I have the following in one of my EE templates:
<!-- Set up dynamic js array for notebook data -->
<script type="text/javascript">
notebooks = [{exp:channel:entries channel="product-notebooks" dynamic="no" backspace="1"}
{"entry_id": "{entry_id}",
"notebook_covertext": "{notebook-covertext}",
"notebook_image": "{notebook-image}"}
,{/exp:channel:entries}
]
</script>
Basically I'd like {notebook-covertext} to escape or htmlentity-ize the content.. anyone know how I can achieve this?
Cheers, John.
Upvotes: 0
Views: 899
Reputation: 1386
You could also try this hidden config variable
$config['protect_javascript'] = 'y';
Upvotes: 3
Reputation: 4564
This plugin should do the trick.
"notebook_covertext": "{exp:mah_eencode}{notebook-covertext}{/exp:mah_eencode}",
Upvotes: 1