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
Highlighted
Shopify Partner
1839 176 680

This is an accepted solution.

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

Liked this post? You might also like our fantastic upsell apps Candy Rack and Candy Cart or offer free gifts with Gift Box. All made with ❤️  and care by Digismoothie
1 Like