News field definition for image - can't get to display
Posted: Fri Nov 09, 2018 9:00 am
I added 2 new field definitions to my news:
I'd like to be able to populate the sizes accordingly but when I try to add:
It makes my page no longer load and shows a 500 error in my console even after I remove the offending code. I have to create a brand new summary template and start over to get it to appear again. Any ideas...?
My template is as follows:
Code: Select all
{foreach from=$items item=entry}
<div class="col-md-12 margin-one-bottom overlay-relative"><a href="{$entry->moreurl}"><img src="https://via.placeholder.com/445x300" style="width:100%;" class="visible-phone"><img src="https://via.placeholder.com/870x300" style="width:100%;" class="visible-desktop visible-tablet"><div class="gradient">{$entry->title|cms_escape}<span>{$entry->postdate|cms_date_format} | READ MORE <i class="fa fa-chevron-right"></i></span></div></a></div>
{/foreach}
Code: Select all
{if isset($entry->445x300)}<img src="{$entry->file_location}/{$entry->445x300}">{/if}