Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted November 29, 20222 yr 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')?
November 29, 20222 yr 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”.
November 29, 20222 yr You can also use the background image template plugin for this. style='{backgroundimage="\IPS\File::get( 'cms_Records', $record->_record_image_thumb )->url"}'