Jump to content

Encapsulate tags in theme hook

Featured Replies

Posted

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.

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.

  • 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.

Recently Browsing 0

  • No registered users viewing this page.