Images with CGFeedMaker
Posted: Sat May 09, 2015 4:22 pm
Hi all,
I'm using CGFeedMaker to display the RSS of the News on my website.
RSS Feed template:
Everything works fine but I would display also the Images of the news on RSS page.
This is my Detail Template in News:
CMS version 1.12
CGFeedMaker 1.0.20
MleCMS 1.11.5
News 2.15.1
Somebody might give me an idea to solve this problem?
Thanks
I'm using CGFeedMaker to display the RSS of the News on my website.
RSS Feed template:
Code: Select all
{* original rss feed template *}
<?xml version="1.0"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
{* note: if you have not configured pretty urls or mod rewrite, the next line may fail when trying to validate the feed *}
<atom:link href="{$feed_url}" rel="self" type="application/rss+xml" />
<title>{$feed.title|cms_escape}</title>
{if isset($feed.link) && !empty($feed.link)}<link>{$feed.link}</link>{/if}
{if isset($feed.description) && !empty($feed.description)}<description>{$feed.description}</description>{/if}
{if isset($feed.copyright) && !empty($feed.copyright)}<copyright>{$feed.copyright}</copyright>{/if}
{if isset($generator)}<generator>{$generator}</generator>{/if}
{if isset($feed.managing_editor) && !empty($feed.managing_editor)}<managingEditor>{$feed.managing_editor}</managingEditor>{/if}
{if isset($admin_email)}<webMaster>{$admin_email} ({$admin_user->firstname} {$admin_user->lastname})</webMaster>{/if}
{if isset($feed.image) && !empty($feed.image)}
<image>
{if isset($feed.description) && !empty($feed.description)}<description>{$feed.description}</description>{/if}
{if isset($feed.link) && !empty($feed.link)}<link>{$feed.link}</link>{/if}
<title>{$feed.title}</title>
<url>{$file_location}/{$feed.image}</url>
</image>
{/if}
{News assign='junk' category='news-it' detailpage=$feed.pageid lang=$lang_locale}
{if isset($items)}
{foreach from=$items item='entry'}
<item>
<title>{$entry->title|cms_html_entity_decode}</title>
<link>{$entry->moreurl}</link>
{capture assign='description'}{if isset($entry->summary)}{$entry->summary} {$entry->content}{/if}{/capture}
<description>{$description|trim|strip_tags|summarize:500}</description>
<pubDate>{$entry->postdate|rfc_date}</pubDate>
<guid>{$entry->moreurl}</guid>
</item>
{/foreach}
{/if}
</channel>
</rss>
This is my Detail Template in News:
Code: Select all
{strip}
<!-- Start news detail template-->
{if isset($entry->canonical)}
{assign var='canonical' value=$entry->canonical}
{/if}
<h2>{assign var='newstitle' value=$entry->title}</h2>
{* <h2>{$entry->title|cms_escape:htmlall}</h2> *}
{if isset($entry->fields)}
{foreach from=$entry->fields item='field'}
{if $field->type == 'file'}
{* this template assumes that every file uploaded is an image of some sort, because News doesn't distinguish *}
<img class="th left" src="{CGSmartImage src1=$entry->file_location src2=$field->value alias1='large_thumbnail' notag=1}"/>
{/if}
{/foreach}
{/if}
<div class="meta">
<p class="noMarginBottom">{if $entry->postdate}<span class="general foundicon-calendar"> {$entry->postdate|cms_date_format}</span>{/if}{if $entry->category} | <span class="general foundicon-paper-clip"> {$entry->category}</span>{/if}{if $entry->author} | <span class="accessibility foundicon-adult"> {$entry->author}</span>{/if}</p>
</div>
{if $entry->summary}
<h4 class="subheader">{eval var=$entry->summary}</h4>
<hr />
{/if}
{eval var=$entry->content}
{if $entry->extra}
<div id="NewsPostDetailExtra">
{$extra_label} {$entry->extra}
</div>
{/if}
{if $return_url != ""}
<p><span class="button radius secondary right small">{$return_url}{if $category_name != ''} - {$category_link}{/if}</span></p>
{/if}
{Disqus disqus_identifier=$entry->id}
{/strip}
CGFeedMaker 1.0.20
MleCMS 1.11.5
News 2.15.1
Somebody might give me an idea to solve this problem?
Thanks