Jump to content

Template error - Missing Record images


Heyhoe

Recommended Posts

Posted

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.RecordViewNotshowing.thumb.png.daa53fcf0

The second is the category view.

2x2GridError.thumb.png.0efb544082b612318

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.

Posted

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"}">

 

Posted

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 :)

Posted
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.

Posted

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}}

 

Posted
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>

 

Posted

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

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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