Comments (2)
I found the problem, but I do not see any solution at the moment.
The custom field I mentioned contains XML data in a textarea. The DOMDocument::loadHTML() method used by the Static Section extension does not like the tag <recipient-groups>
, which is the root element of my XML.
Any ideas how to solve this? This what the output of my custom field looks like:
<label>Recipient Groups
<textarea name="fields[8][rec_groups]" rows="10" cols="50" class="code"><recipient-groups><group id="1" page-id="8" entry-node="entry" name-node="name" email-node="email">Clients</group><group id="2" page-id="13" entry-node="partner" name-node="full-name" email-node="email">Partners</group></recipient-groups></textarea>
</label>
(Hey, this looks really bad, doesn't it? -- I am afraid that this is not valid HTML. So it's my fault...)
from static_section.
I think I found the solution. I can apply General::sanitize() to my XML string when building the field data for the section editor, like so:
$label->appendChild(Widget::Textarea('fields['.$this->get('sortorder').'][rec_groups]', 10, 50, General::sanitize($this->get('rec_groups')), array('class' => 'code')));
This way I get the following HTML:
<label>Recipient Groups
<textarea name="fields[8][rec_groups]" rows="10" cols="50" class="code"><recipient-groups>
<group id="1" page-id="7" entry-node="entry" name-node="name" email-node="email">Clients</group>
<group id="2" page-id="11" entry-node="partner" name-node="full-name" email-node="email">Partners</group>
</recipient-groups></textarea></label>
The XML is nevertheless saved correctly to the database.
So: Problem solved!
from static_section.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from static_section.