Jump to content

Encapsulate tags in theme hook


DreamOn

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...