A conundrum? I have CGBlog installed and have a page that has a main tag in the content block
Code: Select all
{CGBlog detailtemplate="00_newsdetail" detailpage="latest-news" number="1" category="General" action="detail"}
I then have a tag in a content block forming the right hand column which gives a list of posts.
Code: Select all
{CGBlog summarytemplate="00_newspagesummary" detailpage="latest-news" number="5" category="General" detailtemplate="00_newsdetail"}
I am using the following code to select the appropriate image.
Code: Select all
{if isset($entry->fields)}
{foreach $entry->fields as $field}
{if $field->type == 'image' && $field->name == 'Standard Image' && $field->value != ''}
{capture name=newsdetailimg assign=standardnews}{CGSmartImage src1=$entry->file_location src2=$field->value max_width="1000" max_height="800" class="img-responsive" noembed=1 alt=$entry->title}{/capture}
{/if}
{/foreach}
{/if}
{if isset($entry->fields)}
{foreach $entry->fields as $field}
{if $field->type == 'image' && $field->name == 'Revolving image' && $field->value != ''}
{capture name=newsdetailimg2 assign=revolvingnews}{CGSmartImage src1=$entry->file_location src2=$field->value max_width="1000" max_height="800" class="img-responsive" noembed=1 alt=$entry->title}{/capture}
{/if}
{/foreach}
{/if}
{if $standardnews != ''}
{$standardnews}
{elseif $revolvingnews != ''}
{else}---
{/if}
I have tried just calling the image directly without the capture, but the result is the same.
I am running 2.2.7 with all the latest associated modules. PHP version 5.5.38. The only resent changes are upgrade to 2.2.7 and installation of CG content utilities.
Any help would be gratefully received.