Jump to content

Escape apostrophe in template files


Recommended Posts

My code:

<div class='ipsPageHeader ipsBox ipsResponsive_pull ipsPadding ipsClearfix' style='background-image: url('{file="$record->_record_image_thumb" extension="cms_Records"}')'>

Result:

<div class="ipsPageHeader ipsBox ipsResponsive_pull ipsPadding ipsClearfix" style="background-image: url(" https:=""xxx.com="" uploads="" monthly_2022_11="" connor-williams-iir32bprihe-unsplash.thumb.jpg.f54c7b887d3ac0e316547fafa1acd564.jpg="" ')'="">

How to escape the apostrophe to get correct url('image.jpg')?

Link to comment
Share on other sites

I think it should be enough to correct the nesting. You start with style=', but then you end that block with another ' in the '{file. Use double quotes there instead to nest the quotes correctly. 

When two types of quotes aren’t enough, there would also be the option \'
But again, it should not be necessary in your example. 

And correct the “syle” to “style”. 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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