in progress RSS feed question for specific feed options

alt=
@restmin
9 years ago
114 posts
I have a few RSS feeds I want to bring in (from my own main site). I have created them in the RSS feed reader and I see the code to add, but I am not sure how to make it more specific.

For example, this is a feed
{jrFeed_list name="Rest Ministries Devotionals"}

But I would like to make a few options from this:

(1) pull the most recent post and make it the entire post.
(2) pull the last 5 feed titles of posts with no excerpts.
(3) pull the last 3 feed titles with excerpts.

I have no clue how to figure out the code for this.
If you can give me a hint, maybe I can go from there.

Do you recommend a good quick lesson on this kind of coding somewhere?

Thank you!
updated by @restmin: 05/26/15 08:50:26AM
gary.moncrieff
gary.moncrieff
@garymoncrieff
9 years ago
865 posts
I haven't a lot of time this morning but

1. I don't believe this is possible without using some sort of parser in the middle.
2. You will need to define a new template to use in the feed call, something like this might work

{if isset($jrFeed.feed)}
    <div class="title"><h2>{$jrFeed.feed.title}</h2></div>
    <div class="block_content">
        <div class="item" style="height:462px;overflow:auto;">
            {if isset($jrFeed.feed.item)}
                {foreach from=$jrFeed.feed.item item="item"}
                    <div class="normal">
                        <a href="{$item.link}">{$item.title}</a><br>
                        {$item.pubDate|jrCore_date_format}<br>
                    </div>
                    <hr>
                {/foreach}
            {/if}
        </div>
    </div>
{/if}

Then you'd call it using something like

{jrFeed_list name="Rest Ministries Devotionals" limit="5" template="new_template.tpl"}

3.
{jrFeed_list name="Rest Ministries Devotionals" limit="3"}
michael
@michael
9 years ago
7,746 posts
Exactly what @garymoncrieff said ^^. Thanks Gary :)

You only have what the feed gives you to work with. You can reformat that using the template="something.tpl" system.

That file would go at:
/skins/(YOUR SKIN)/something.tpl

You'd need to put it there via FTP, then you can edit it via the TEMPLATE tab in your skin. A feature is coming to add a file via the ACP so you can skip the FTP step, but isn't in the system yet.
gary.moncrieff
gary.moncrieff
@garymoncrieff
9 years ago
865 posts
michael:
A feature is coming to add a file via the ACP so you can skip the FTP step, but isn't in the system yet.

It might be a wise idea to prefix template names added this way with the skin name, ensuring they never overwrite a profile with the same name etc. Whether or not that is feasible is another idea, its just the first thought that came into my head after reading about that feature. Of course the admin can delete the prefix if they wanted.

Sorry for the off topic post.
updated by @garymoncrieff: 04/16/15 03:21:25AM
alt=
@restmin
9 years ago
114 posts
thank you!
derrickhand300
@derrickhand300
9 years ago
1,353 posts
I wish I could wrap my brain around this...
Right now I want an RSS feed off of my members page to display "Newest Members"
I am able to get that feed here
http://drillingahead.com/feed/profile
Only I want the code changed so that it ONLY displays the user image ( and user name on mouseover)

I have 2 rss templates to edit
rss.tpl
rss_list.tpl

First question is which template do I use as a starting template for my feed or do I combine both?
Second question is really more of a matter of requesting a HELP document on this explaining a few examples of editing the RSS template
For instance if you want to remove description do this
If you want to add an image do this..etc
Wondering if you figured this out Restmin?

Looking at it I come up with something like this
{if isset($jrFeed.feed)}
    <div class="title"><h2>{$jrFeed.feed.Newest Members}</h2></div>
    <div class="block_content">
        <div class="item" style="height:462px;overflow:auto;">
            {if isset($jrFeed.feed.item)}
                {foreach from=$jrFeed.feed.item item="item"}
                    <div class="normal">
                        <a href="{$item.link}">{$item.title}</a><br>
                       <br>
                        {$item.image}<br>
                    </div>
                    <hr>
                {/foreach}
            {/if}
        </div>
    </div>
{/if}

But I know this has to be way off...

updated by @derrickhand300: 04/20/15 11:57:04AM
michael
@michael
9 years ago
7,746 posts
Its only way off because its not RSS feed structure. an RSS feed uses XML send data in a set structure. You need to know the structure you want to achieve. That will be the base for what you need to put in the template.

XML doesn't use div's it uses ITEM, and TITLE and DESCRIPTION and others. eg that page you link to's source code currently looks like this:
<?xml version="1.0"?>
<rss version="2.0">
    <channel>
        <title></title>
        <description></description>
        <link>http://drillingahead.com/feed/profile</link>
        <lastBuildDate>Mon, 20 Apr 2015 21:20:19 CST</lastBuildDate>
                    <item>
                <title>@Salah-addine M. F. Abodhir</title>
                <link>http://drillingahead.com/salah-addine-m-f-abodhir</link>
                <description> Tell Our Members About Yourself Here </description>
                <pubDate>Mon, 20 Apr 2015 03:35:33 CST</pubDate>
            </item>
                    <item>
                <title>@fazal.subhan</title>
                <link>http://drillingahead.com/fazalsubhan</link>
                <description></description>
                <pubDate>Sun, 19 Apr 2015 07:16:23 CST</pubDate>
            </item>
                    <item>
                <title>@TEC_hand</title>
                <link>http://drillingahead.com/tec-hand</link>
                <description> Tell Our Members About Yourself Here </description>
                <pubDate>Sun, 19 Apr 2015 07:08:15 CST</pubDate>
            </item>

Put a file in your skin at:
/skins/(YOUR SKIN)/jrProfile_item_rss.tpl

Then adjust the code from there. The best place to start is if you know a place that has the RSS feed structure you want, then copy that that first, put it in your .tpl file and fire it up.

If it works, then you know the structure is good and you can swap out the recurring bits for data coming from your datastore.

Tags