DreamOn Posted December 28, 2017 Posted December 28, 2017 Hi, Is there a way to encapsulate an element with theme hook? This doesn't work: array ( 0 => array ( 'selector' => 'li.ipsDataItem.ipsDataItem_responsivePhoto', 'type' => 'add_before', 'content' => '{{if $row->mapped(\'pinned\') === 1}}<div class="pinned">{{endif}}', ), 1 => array ( 'selector' => 'li.ipsDataItem.ipsDataItem_responsivePhoto', 'type' => 'add_after', 'content' => '{{if $row->mapped(\'pinned\') === 1}}</div>{{endif}}', ), The first hook create auto two tags at the beggining instead of one : <div class="pinned"></div>. Thanks.
teraßyte Posted December 28, 2017 Posted December 28, 2017 Unfortunately that's how IPS coded the hook to work, if you have an open HTML tag it closes it. It's been that way since 4.0 even thought I've seen multiple complaints about it. That said, after creating/exporting the hook you may be able manually edit the file to work the way you want. I am not sure if importing it would again add the closing HTML tags but it's worth a shot at least.
DreamOn Posted January 5, 2018 Author Posted January 5, 2018 Thanks! So there is no way to add a html container with hooks? We have to create custom theme unfortunately? :/
Recommended Posts
Archived
This topic is now archived and is closed to further replies.