Hello,
Based off of the Primer and Reference I’m trying to create a custom element.
I’ve hit a bit of a wall trying to get the Style Section/CSS to work. I have the custom element displaying the standard Design elements(“Margin”, “Padding”, “Border”, etc…) but when I adjust the slider’s nothing renders. I suspect either the Render function or the Style function aren’t referenced properly.
The element as a whole just returns a shortcode. I removed any css classes associated with the shortcode to be sure there were no conflicts there.
Currently have it like this:
function manager_element_style() {
ob_start();
?>
.$_el {
margin: $content_margin;
padding: $content_padding;
}
<?php
return ob_get_clean();
}
Here is the render function. One note: the API Primer says I need to add a cs_attr_class() in the cs_atts() but I’ve found it critical errors my site as the function does not exist.
function manager_element_renders($data) {
extract($data);
$atts = cs_atts([
'Item' => $Item,
'Location' => $Location,
'ItemSettings' => $ItemSettings,
]);
$return = do_shortcode("[item " . $item . $display . " ]");
return "<div $atts> $return </div>";
}```