Replace text in section

Solved
Highlighted
New Member
2 0 0

Is there any way to do a replace operation for the entire HTML of a section?

 

So for example:

 instead of: 

{% section 'footer' %}

and I want to replace some text in the auto-generated section tags, I try to write it like this: 

{% section 'footer' | replace: 'shopify-section', 'my-section' %}

 

The above code doesn't work and I can't save the liquid file with error:  

Liquid syntax error: Error in tag 'section' - Valid syntax: section '[type]'

 

Is it possible to do such a thing? If so, what is the correct syntax?

0 Likes

Success.

Shopify Partner
1843 171 543

Yeah, there's a clever / dirty hack (depends on time of day and angle you look at it) described here.

I turn coffee in to code - since 1998
1 Like