Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Heyhoe Posted September 30, 2015 Posted September 30, 2015 Somehow I have edited a template which now stops record images from showing on two areas of my site. The first area is on the actual record view. The record image is not showing. The second is the category view. This is the code from the "record" template <article class='ipsContained ipsSpacer_top'> {{if $record->record_image}} <div class="cCmsRecord_image"> <img class="ipsImage" src="{$record->record_image}"> </div> {{endif}} <div> And this is the code from the 2x2 category template "recordRow" <div class='cCmsRecordImage'> <a href="{$row->url()}" title="{lang="read_more_about" sprintf="$row->_title"}"> <img class="ipsImage" src="{file="$record-> </a> {{if $row->field_37}} {$row->customFieldDisplayByKey('krscore','listing')|raw} {{endif}} {{if $row->field_40}} {$row->customFieldDisplayByKey('brand','display')|raw} {{endif}} {{if $row->field_41}} {$row->customFieldDisplayByKey('price','display')|raw} {{endif}} {{if $row->field_42}} {$row->customFieldDisplayByKey('retailer','display')|raw} {{endif}} </div> The second template is used/duplicated 9 times as I use it to show different information depending on which category the record is in. IPS have told me that it's an issue with my template and not with the software. The images upload correctly as they still show on the main index page of my site. Could anyone tell me what is wrong with one or both of the templates to cause this issue? To add, some records display the image correctly on the "record" view until the record is edited. Once you save the record it no longer shows the image. Any help appreciated. Paul.
Daniel F Posted October 3, 2015 Posted October 3, 2015 There's some code missing in your 2x2 category template "recordRow" template src="{file="$record-> should be src="{file="$record->record_image" extension="cms_Records"}"> also your record template is wrong <img class="ipsImage" src="{$record->record_image}"> should be <img class="ipsImage" src="{file="$record->record_image" extension="cms_Records"}">
Heyhoe Posted October 3, 2015 Author Posted October 3, 2015 I'm not sure how they got removed and how it's not been noticed until now as the same error was duplicated in 9 categories months ago. Well, it works now! Thanks
Heyhoe Posted October 3, 2015 Author Posted October 3, 2015 Hmnm, the 2x2 grid display still seems to be giving problems.
Heyhoe Posted October 4, 2015 Author Posted October 4, 2015 @Daniel F the 2x2 template is still not showing. I seem to remember the code was different to that of the recordRow..
Heyhoe Posted October 7, 2015 Author Posted October 7, 2015 Can anyone recommend a fix for this? The 2x2 template is not showing images with the code posted above...
Heyhoe Posted October 12, 2015 Author Posted October 12, 2015 Anyone? I'm sure it's pretty simple but I am having no luck solving it. Thanks.
Ugur Kaya Posted October 12, 2015 Posted October 12, 2015 1 minute ago, Heyhoe said: Anyone? I'm sure it's pretty simple but I am having no luck solving it. Thanks. What does the url of the thumbnails like ? Can you post the results here please.
Heyhoe Posted October 12, 2015 Author Posted October 12, 2015 Currently the template is edited as the advice above and it looks like the thumbnails are just pointing to "http://www.kartreview.co.uk/uploads/" <div class='cCmsRecordImage'> <a href="{$row->url()}" title="{lang="read_more_about" sprintf="$row->_title"}"> <img class="ipsImage" src="{file="$record->record_image" extension="cms_Records"}"> </a> </div> This is the 2x2 category teamplate named "recordRow" Thanks in advance. This is the complete template. {{$rowIds = array();}} {{foreach $rows as $row}} {{$idField = $row::$databaseColumnId;}} {{$rowIds[] = $row->$idField;}} {{endforeach}} {{$iposted = ( $table AND method_exists( $table, 'container' ) AND $table->container() !== NULL ) ? $table->container()->contentPostedIn( null, $rowIds ) : array();}} {{foreach $rows as $row}} {{$idField = $row::$databaseColumnId;}} <li class="cCmsRecord_row ipsClearfix ipsDataItem ipsDataItem_responsivePhoto {{if $row->unread()}}ipsDataItem_unread{{endif}} {{if method_exists( $row, 'tableClass' ) && $row->tableClass()}}ipsDataItem_{$row->tableClass()}{{endif}} {{if $row->hidden()}}ipsModerated{{endif}}" data-rowID='{$row->$idField}'> <div class='listingbox'> <div class='ipsDataItem_main'> <h2 class='ipsType_pageTitle ipsType_break'> {{if $row->locked()}} <i class='fa fa-lock' data-ipsTooltip title='{lang="content_locked_record"}'></i> {{endif}} {{if $row->prefix()}} {template="prefix" group="global" app="core" params="$row->prefix( TRUE ), $row->prefix()"} {{endif}} <a href='{$row->url()}'> {{if $row->_title}}{$row->_title}{{else}}<em class="ipsType_light">{lang="content_deleted"}</em>{{endif}} </a> {{if member.member_id}} {{if $row->unread()}} <a href='{$row->url( 'getNewComment' )}' title='{lang="first_unread_post"}' data-ipsTooltip> <span class='ipsItemStatus'><i class="fa {{if in_array( $row->$idField, $iposted )}}fa-star{{else}}fa-circle{{endif}}"></i></span> </a> {{else}} {{if in_array( $row->$idField, $iposted )}} <span class='ipsItemStatus ipsItemStatus_read ipsItemStatus_posted'><i class="fa fa-star"></i></span> {{else}} {{endif}} {{endif}} {{endif}} {{if $table and $table->canModerate()}} <input type='checkbox' data-role='moderation' name="moderate[{$row->$idField}]" data-actions="{expression="implode( ' ', $table->multimodActions( $row ) )"}" data-state='{{if $row->tableStates()}}{$row->tableStates()}{{endif}}'> {{endif}} </h2> <div class='cCmsRecordImage'> <a href="{$row->url()}" title="{lang="read_more_about" sprintf="$row->_title"}"> <img class="ipsImage" src="{file="$record->record_image" extension="cms_Records"}"> </a> {{if $row->field_37}} {$row->customFieldDisplayByKey('krscore','listing')|raw} {{endif}} {{if $row->field_40}} {$row->customFieldDisplayByKey('brand','display')|raw} {{endif}} {{if $row->field_41}} {$row->customFieldDisplayByKey('price','display')|raw} {{endif}} {{if $row->field_42}} {$row->customFieldDisplayByKey('retailer','display')|raw} {{endif}} </div> <br> <!--<div data-ipsTruncate data-ipsTruncate-size='4 lines' data-ipsTruncate-type='remove'> {$row->truncated()|raw} </div>--> {{if $row->isFutureDate() || $row->mapped('pinned') || $row->mapped('featured') || $row->hidden() === -1 || $row->hidden() === 1}} <span> {{if $row->isFutureDate()}} <span class="ipsBadge ipsBadge_icon ipsBadge_small ipsBadge_warning" data-ipsTooltip title='{$row->futureDateBlurb()}'><i class='fa fa-clock-o'></i></span> {{elseif $row->hidden() === -1}} <span class="ipsBadge ipsBadge_icon ipsBadge_small ipsBadge_warning" data-ipsTooltip title='{$row->hiddenBlurb()}'><i class='fa fa-eye-slash'></i></span> {{elseif $row->hidden() === 1}} <span class="ipsBadge ipsBadge_icon ipsBadge_small ipsBadge_warning" data-ipsTooltip title='{lang="pending_approval"}'><i class='fa fa-warning'></i></span> {{endif}} {{if $row->mapped('pinned')}} <span class="ipsBadge ipsBadge_icon ipsBadge_small ipsBadge_positive" data-ipsTooltip title='{lang="pinned"}'><i class='fa fa-thumb-tack'></i></span> {{endif}} {{if $row->mapped('featured')}} <span class="ipsBadge ipsBadge_icon ipsBadge_small ipsBadge_positive" data-ipsTooltip title='{lang="featured"}'><i class='fa fa-star'></i></span> {{endif}} </span> {{endif}} {{if $row->commentPageCount() > 1}} {$row->commentPagination( array(), 'miniPagination' )|raw} {{endif}} </div> </div> </li> {{endforeach}}
Ugur Kaya Posted October 12, 2015 Posted October 12, 2015 2 minutes ago, Heyhoe said: Currently the template is edited as the advice above and it looks like the thumbnails are just pointing to "http://www.kartreview.co.uk/uploads/" <div class='cCmsRecordImage'> <a href="{$row->url()}" title="{lang="read_more_about" sprintf="$row->_title"}"> <img class="ipsImage" src="{file="$record->record_image" extension="cms_Records"}"> </a> </div> This is the 2x2 category teamplate named "recordRow" Thanks in advance. Can you try to replace your code with ; <div class='cCmsRecordImage'> <a href="{$row->url()}" title="{lang="read_more_about" sprintf="$row->_title"}"> <img class="ipsImage" src="{file="$row->_record_image" extension="cms_Records"}"> </a> </div>
Heyhoe Posted October 12, 2015 Author Posted October 12, 2015 Still appears to be the same. http://www.kartreview.co.uk/reviews/too/
Ugur Kaya Posted October 12, 2015 Posted October 12, 2015 7 minutes ago, Heyhoe said: Still appears to be the same. http://www.kartreview.co.uk/reviews/too/ <div class='cCmsRecordImage'> <a href="{$row->url()}" title="{lang="read_more_about" sprintf="$row->_title"}"> <img class="ipsImage" src="{file="$record->record_image" extension="cms_Reviews"}"> </a> </div> Can you try it ?
Heyhoe Posted October 12, 2015 Author Posted October 12, 2015 Still no luck . Tried re-caching etc but no joy.
newbie LAC Posted October 12, 2015 Posted October 12, 2015 Hello, 51 minutes ago, Heyhoe said: <div class='cCmsRecordImage'> <a href="{$row->url()}" title="{lang="read_more_about" sprintf="$row->_title"}"> <img class="ipsImage" src="{file="$record->record_image" extension="cms_Records"}"> </a> </div> Why do you use $record here? Must be $row
Heyhoe Posted October 12, 2015 Author Posted October 12, 2015 @newbie LAC Is this in the div class or the img class? Regards, Paul. EDIT: Changed to $row and it works perfectly Thanks!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.