Publication on social networks with rss

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
Mich-adg
Forum Members
Forum Members
Posts: 200
Joined: Sat Aug 02, 2008 9:08 pm

Publication on social networks with rss

Post by Mich-adg »

Hi,
i'm testing publication on social networks like Facebook, Twitter ... with the help of CGFeedMaker and News module.
For texts it works well with services like IFTTT, Dlvr.it... But no luck with images (enclosure tag - i checked my feed and it's valid rss 2.0).
I made a custom field to add this image (i don't want to add the image in the article content).
Does anybody have a tip to achieve this?
(I know that some services don't handle enclosure tags...)
Thx !
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: Publication on social networks with rss

Post by Rolf »

- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
Mich-adg
Forum Members
Forum Members
Posts: 200
Joined: Sat Aug 02, 2008 9:08 pm

Re: Publication on social networks with rss

Post by Mich-adg »

Thanks for the link, but it doesn't help me.
I can display an image inside a CDATA tag, but it is not displayed in Facebook. With Dlvr.it, i changed the image detection to "Auto-detect in item content", nothing changes...
Does anybody tried the "enclosure" tag, or <media:thumbnail> ?

Heres's my CGFeedMaker template:

Code: Select all

<?xml version="1.0"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
  <atom:link href="{$feed_url}" rel="self" type="application/rss+xml" />
    <title>{$feed.title}</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='Blog*' detailtemplate='detblog' detailpage='blog'}
    {foreach from=$items item='entry'}
        {assign var='imgpath' value="`$entry->file_location`/`$entry->fieldsbyname.image->value`"}
    <item>
      <title>{$entry->title|cms_html_entity_decode}</title>
      {capture assign='description'}{if $entry->summary}{eval var=$entry->summary}{else}{eval var=$entry->content}{/if}{/capture}
      <link>{$entry->moreurl}</link>
      <description>
         <![CDATA[
            {CGSmartImage src=$imgpath width='200'}
            {$description|trim|strip_tags|truncate:100} 
         ]]>
      </description>
      <pubDate>{$entry->postdate|rfc_date}</pubDate>
      <guid>{$entry->moreurl}</guid>
    </item>
    {/foreach}
  </channel>
</rss>
Post Reply

Return to “The Lounge”