Forum
Text Item Removes Div Formatting
Hello, I am having issues with adding content to one of the items in a region. I add the following code:
<div style="display:none;background:#D74D4F;border:dashed 4px #FF0004;box-sizing:border-box;text-align:center;align-content:center;">
<p>Clicking "Subscribe" more than once could result in being charged more than once.</p>
</div>
But upon saving I find that the code was reduced to:
<p>Clicking "Subscribe" more than once could result in being charged more than once.</p>
Which removed all of the formatting. Just above this section is a div that has formatting that seems to work:
<div style="background:#eee; border:1px solid #ccc; padding:5px 10px"><strong>After signing up for one of these services, you will receive several emails with detailed instructions on setting up your device. You should receive these emails with 48 hours.</strong></div>
Mimicking this div and having the exact same styling causes the div I'm trying to add to work properly, but reducing the styling on the div to even just a background attribute still results in the simple paragraph tag.
If you need the diagnostics report, here it is:
Perch: 2.8.13, PHP: 5.4.43, MySQL: mysqlnd 5.0.10 - 20111026 - $Id: c85105d7c6f7d70d609bb4c000257868a40840ab $, with PDO
Server OS: Linux, cgi-fcgi
Installed apps: content (2.8.13), assets (2.8.13), categories (2.8.13), perch_forms (1.8.2), perch_shop_foxycart (2), perch_shop_foxycart (2.1), perch_members (1.3), perch_backup (1.2)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_forms', 'perch_shop_foxycart', 'perch_members' );
PERCH_LOGINPATH: /perch
PERCH_PATH: /home/cloudveil/public_html/perch
PERCH_CORE: /home/cloudveil/public_html/perch/core
PERCH_RESFILEPATH: /home/cloudveil/public_html/perch/resources
Image manipulation: GD Imagick
PHP limits: Max upload 32M, Max POST 48M, Memory: 64M, Total max file upload: 32M
Resource folder writeable: Yes
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
REQUEST_URI: /perch/core/settings/diagnostics/
DOCUMENT_ROOT: /home/cloudveil/public_html
HTTP_HOST: cloudveil.org
I'm really confused. Is anyone out there able to enlighten me?
I think you would really need to post your template code to work out why it's stripping html. Does the template for the field you're posting in have html="true" for example? If not, it may strip the markup.
I would be tempted, where possible, to put the HTML in the template, so you only have to enter the text in the CMS. That may not be possible in your setup, but that's what I'd aim for.
You've categorised this post as CKEditor - is that where you're entering your HTML? If so, you need to check with the CKEditor project about how it handles HTML, as it's not something Perch is doing.
I don't seem to have striptags enabled (nor disabled, but I hope that's the default), and I do have html="true" enabled in that place, but if it were stripping based on a setting then that other div wouldn't/shouldn't be able to exist the way it does, anyway.
Here is the template code:
In this situation I don't really think I want to put it into the template, though I suppose I could create a new template based off this one to allow for my specific circumstance.
I see. I will check there, then! Thank you.
That made it work fine. Thanks for the help!