Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted December 28, 20177 yr 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.
December 28, 20177 yr 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.
January 5, 20187 yr Author Thanks! So there is no way to add a html container with hooks? We have to create custom theme unfortunately? :/
Archived
This topic is now archived and is closed to further replies.