CGFeedmaker and Gallery module

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
User avatar
argraff
Forum Members
Forum Members
Posts: 52
Joined: Wed Nov 28, 2007 12:10 am

CGFeedmaker and Gallery module

Post by argraff »

Hi all! After fighting for a few hours on this, I thought I'd share the template I created for creating an RSS feed out of the Gallery module. It could certainly use an expert's touch to polish it up. You can see it in action at http://www.northoftheridge.com/whats-new.

Code: Select all

<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <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}</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}
 
    {capture assign='photos'}
      {Gallery action="showlatest" number="9"}
    {/capture}    

    {foreach from=$images item='image'}
    <item>
      <title>{$image->title}</title>
      <link>{root_url}/XXXXXX</link>
      <description>
	   <![CDATA[<a href="{root_url}/XXXXXX"><img src="{root_url}/{$image->thumb}" alt="{$image->title}" /></a><br/>
	   {$image->comment}<hr />]]>
      </description>
    </item>
    {/foreach}
  </channel>
</rss>
NOTE! The part after the {root_url} bit is specific to my page - you'll have change this to your own page if you don't want it directed to your root url. The reason for this is that I couldn't find a way to get an automatic hard link to each photo. (Actually, I'd like to have it link from the picture/title to the page it's on, not the image alone.)

If you can use this, awesome. If you can improve this, even better! Post revisions below. :)
Registered Linux User #457788
dcleckley
Forum Members
Forum Members
Posts: 127
Joined: Fri Mar 06, 2009 2:13 pm

Re: CGFeedmaker and Gallery module

Post by dcleckley »

This is a very interesting concept. I like it.  I am trying to do something similar but apply a link to a page from the thumbnail, instead of a larger picture.
User avatar
argraff
Forum Members
Forum Members
Posts: 52
Joined: Wed Nov 28, 2007 12:10 am

Re: CGFeedmaker and Gallery module

Post by argraff »

If you could figure that out - you'd be a hero in my book.
Registered Linux User #457788
Post Reply

Return to “Modules/Add-Ons”