thumbnails not appearing on news summary - displayvalue

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
turpentyne
Forum Members
Forum Members
Posts: 34
Joined: Tue Oct 08, 2013 8:29 pm

thumbnails not appearing on news summary - displayvalue

Post by turpentyne »

I've created a new "file" field in the news section, and set up a place in the template to show the image in the news article. It works fine. I tried to reference the same image in the news summary with same code (<img src="{$entry->file_location}/{$field->displayvalue}" /> ( and it's not working. For some reason, it shows the url up to the file name - but no file name: {$field->displayvalue} gives nothing? So, nothing shows. (working with cmsms 1.11.7)

Here's the template for my summaries:

Code: Select all


{foreach from=$items item=entry}
<div class="newsthumb1">
<!-- here's where I want the image to appear -->
<div class="NewsSummaryField" >
{if isset($entry->fields)}
  {foreach from=$entry->fields item='field'}
        {if $field->type == 'file'}
<a href="{$entry->moreurl}" title="{$entry->title|cms_escape:htmlall}">
{$image->thumb}
<!-- and here's the image that's not working properly -->
<!-- all I get is: img src="http://www.url.com/news/id25/"
          <img src="{$entry->file_location}/{$field->displayvalue}" style="width:100%;"/> 
</a>
        {else}
          {$field->name}:&nbsp;{eval var=$field->displayvalue}
        {/if}
  {/foreach}
{/if}
</div>
</div>


<div class="NewsSummary">

{if $entry->postdate}
	<div class="NewsSummaryPostdate">
		{$entry->postdate|cms_date_format}
	</div>
{/if}

<div class="NewsSummaryLink">
<a href="{$entry->moreurl}" title="{$entry->title|cms_escape:htmlall}">{$entry->title|cms_escape}</a>
</div>

<div class="NewsSummaryCategory">
	{$category_label} {$entry->category}
</div>

{if $entry->author}
	<div class="NewsSummaryAuthor">
		{$author_label} {$entry->author}
	</div>
{/if}

{if $entry->summary}
	<div class="NewsSummarySummary">
		{eval var=$entry->summary} &nbsp; <span style="font-style:italic;">{$entry->morelink}</span>
           <div class="NewsSummaryMorelink">
		&nbsp;
	   </div>

	</div>

	
{else if $entry->content}

	<div class="NewsSummaryContent">
		{eval var=$entry->content}
	</div>
{/if}

{if isset($entry->extra)}
    <div class="NewsSummaryExtra">
        {eval var=$entry->extra}
	{* {cms_module module='Uploads' mode='simpleurl' upload_id=$entry->extravalue} *}
    </div>
{/if}

</div>
{/foreach}
<!-- End News Display Template -->

staartmees
Power Poster
Power Poster
Posts: 1049
Joined: Wed Mar 19, 2008 4:54 pm

Re: thumbnails not appearing on news summary - displayvalue

Post by staartmees »

to call a custom field I use

Code: Select all


<img src="{eval var=$entry->name-of-custom-field}" width="320" height="240">

the value of the custom field is

Code: Select all


http://www.example.com/cms/uploads/images/imagename.jpg

Post Reply

Return to “Modules/Add-Ons”