Open svandragt opened 4 years ago
Content Includes should register a cf:id tag where id is unique to the include. CF adds a way to extract embedded xml content and call the CI matching the CI id, which can then process the xml content. Example:
cf:id
id
<?php $html = <<<HTML some paragraph another paragraph <cf:nml mode="list" columns="artist,title">content</cf:nml> <cf:nml mode="view" columns="title">content</cf:nml> final paragraph. HTML; $xml = @simplexml_load_string(sprintf('<xml>%1$s</xml>',$html)); $tag = "cf:nml"; foreach ($xml->$tag as $t) { var_dump($t); } /* object(SimpleXMLElement)#4 (2) { ["@attributes"]=> array(2) { ["mode"]=> string(4) "list" ["columns"]=> string(12) "artist,title" } [0]=> string(7) "content" } object(SimpleXMLElement)#5 (2) { ["@attributes"]=> array(2) { ["mode"]=> string(4) "view" ["columns"]=> string(5) "title" } [0]=> string(7) "content" } */
Might call the element “include” with a type attribute. Depends on the cleanest way to register it
So this is a User Shortcode Register
Content Includes should register a
cf:id
tag whereid
is unique to the include. CF adds a way to extract embedded xml content and call the CI matching the CI id, which can then process the xml content. Example: