Re: [campsite-support] RSS feed problems
  • Dear Robert,

    The tpl parameter is needed to select the RSS template. Why would be an URL
    like: http://site/?tpl3 create any problem?

    Mugur

    On Sat, Feb 20, 2010 at 6:50 PM, wrote:

    > Author: RobertB
    > Link: http://code.campware.org/phorum/read.php?8,8152,8152#msg-8152
    >
    > --------------------------------------------------------------------------------
    >
    > Today I create RSS feed for our web.
    > I followed the instructions in the manual:
    > http://code.campware.org/manuals/campsite/3.3/index.php?id2&lang=en-us
    >
    > Everything went OK, but I stumbled on this problem:
    >
    > 1. If I make new section for RSS and assign rss template to this section
    > Everything is OK. The links to the news in RSS feed are valid.
    >
    > 2. If I make link to RSS feed by "URI" keyword:
    > {{ local }}
    > {{ unset_issue }}
    > {{ unset_section }}
    > RSS Feed
    > {{ /local }}
    >
    > The links in the RSS feed in this case are not valid:
    > *******
    >
    > Svet na dlani – tokrat o Angoli
    > *******
    >
    > Correct would be:
    > *******
    >
    > Svet na dlani – tokrat o Angoli
    > *******
    >
    > What is the cause of the appendix in every URL of news:
    > ?tpl92
    >
    > Any idea for solution?
    > Thanks
    > Robert
    >
    > p.s.
    > I also suggest that in the RSS instructions (in manual) change the record
    > on the date of the RDF date and time format for RSS feed from:
    >
    > {{ $campsite->article->publish_date|camp_date_format:"%Y-%m-%d"
    > }}T00:00:00+00:00
    >
    > to:
    > {{
    > $campsite->article->publish_date|camp_date_format:"%Y-%m-%dT%H:%i:%S+01:00"
    > }}
    >
    > according to ISO 8601
    > ********
    > Year and Month and Day and Hours and Minutes plus Time Zone offset:
    > CCYY-MM-DDThh:mmTZD (e.g. 1999-07-01T19:30+10:00)
    > ********
    >
    >
    > --
    > Sent from Campware Forums
    > http://code.campware.org/phorum
    >
  • 5 Comments sorted by
  • Mugur Rus Wrote:
    -------------------------------------------------------
    > Dear Robert,
    >
    > The tpl parameter is needed to select the RSS
    > template. Why would be an URL
    > like: 3 create any problem?
    >
    Dear Mugur,
    I'd like to have more RSS chanels, so I need more rss.tpl templates (for every section).

    But if I load RSS feed by URI, the links to articles in the feed are not valid, Try:
    http://radio.ognjisce.si/sl/?tpl=1092


    If I make new section for RSS and assign rss template to this section
    Everything is OK. The links to the news in RSS feed are valid.
    http://radio.ognjisce.si/sl/radio/rss/

    Template is the same for both...

    Thanks for your help
    Robert
  • Replace all occurrences of:
    {{ url }}
    with:
    {{ url options="article" }}

    The following lines contain {{ url }}:


    ..

    ..
    {{ url }}

    This should fix your problem.

    Mugur

    On Sun, Feb 28, 2010 at 8:31 PM, wrote:

    > Author: RobertB
    > Link: http://code.campware.org/phorum/read.php?8,8175,8177#msg-8177
    >
    > --------------------------------------------------------------------------------
    >
    > Mugur Rus Wrote:
    > -------------------------------------------------------
    > > Dear Robert,
    > >
    > > The tpl parameter is needed to select the RSS
    > > template. Why would be an URL
    > > like: 3 create any problem?
    > >
    > Dear Mugur,
    > I'd like to have more RSS chanels, so I need more rss.tpl templates (for
    > every section).
    >
    > But if I load RSS feed by URI, the links to articles in the feed are not
    > valid, Try:
    > http://radio.ognjisce.si/sl/?tpl=1092
    >
    >
    > If I make new section for RSS and assign rss template to this section
    > Everything is OK. The links to the news in RSS feed are valid.
    > http://radio.ognjisce.si/sl/radio/rss/
    >
    > Template is the same for both...
    >
    > Thanks for your help
    > Robert
    >
    > --
    > Sent from Campware Forums
    > http://code.campware.org/phorum
    >
  • Thanks Mugur, thanks a lot...
    Excellent work!

    Robert

    For all those interested will attach a revised code for Manual page
    6.2. Creating an RSS feed for your site:

    Step 2) Create the link to your RSS feed.
    You can do this by using the "URI" keyword:

    {{ local }}
    {{ unset_issue }}
    {{ unset_section }}
    RSS Feed
    {{ /local }}

    -----------------------------------------------------------------------
    rss.tpl
    -----------------------------------------------------------------------
    {{ php }}
    ob_start();
    {{ /php }}
    xmlns="http://purl.org/rss/1.0/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">


    Some title
    http://some.site.com
    News
    en-us


    {{ local }}
    {{ set_language name="English" }}
    {{ unset_issue }}
    {{ unset_section }}
    {{ list_articles length="15" constraints="OnFrontPage is on" order="bydate desc" ignore_issue="true" }}

    {{ /list_articles }}
    {{ /local }}




    {{ local }}
    {{ set_language name="English" }}
    {{ unset_issue }}
    {{ unset_section }}
    {{ list_articles length="15" constraints="OnFrontPage is on" order="bydate desc" ignore_issue="true" }}

    {{ $campsite->article->name }}
    {{ url options="article" }}
    article->intro }}... ]]>
    {{ $campsite->article->publish_date|camp_date_format:"%Y-%m-%dT%H:%i:%S+01:00" }}

    {{ /list_articles }}
    {{ /local }}


    {{ php }}
    header("Content-type: text/xml");
    $content = ob_get_clean();
    echo '';
    echo $content;
    {{ /php }}
  • The manual page was already updated

    On Sun, Feb 28, 2010 at 9:41 PM, wrote:

    > Author: RobertB
    > Link: http://code.campware.org/phorum/read.php?8,8175,8179#msg-8179
    >
    > --------------------------------------------------------------------------------
    >
    > Thanks Mugur, thanks a lot...
    > Excellent work!
    >
    > For all those interested will attach a revised code for Manual page
    > 6.2. Creating an RSS feed for your site:
    >
    > Step 2) Create the link to your RSS feed.
    > You can do this by using the "URI" keyword:
    >
    > {{ local }}
    > {{ unset_issue }}
    > {{ unset_section }}
    > RSS Feed
    > {{ /local }}
    >
    > -----------------------------------------------------------------------
    > rss.tpl
    > -----------------------------------------------------------------------
    > {{ php }}
    > ob_start();
    > {{ /php }}
    >
    >
    >
    > Some title
    > http://some.site.com
    > News
    > en-us
    >
    >
    > {{ local }}
    > {{ set_language name="English" }}
    > {{ unset_issue }}
    > {{ unset_section }}
    > {{ list_articles length="15" constraints="OnFrontPage is on"
    > order="bydate desc" ignore_issue="true" }}
    >
    > {{ /list_articles }}
    > {{ /local }}
    >
    >
    >
    >
    > {{ local }}
    > {{ set_language name="English" }}
    > {{ unset_issue }}
    > {{ unset_section }}
    > {{ list_articles length="15" constraints="OnFrontPage is on"
    > order="bydate desc" ignore_issue="true" }}
    >
    > {{ $campsite->article->name }}
    > {{ url options="article" }}
    >
    > {{
    > $campsite->article->publish_date|camp_date_format:"%Y-%m-%dT%H:%i:%S+01:00"
    > }}
    >
    > {{ /list_articles }}
    > {{ /local }}
    >
    >
    > {{ php }}
    > header("Content-type: text/xml");
    > $content = ob_get_clean();
    > echo '';
    > echo $content;
    > {{ /php }}
    >
    > --
    > Sent from Campware Forums
    > http://code.campware.org/phorum
    >
  • Mugur thanks!
    Maybe only this also
    This code must be in one line, I think someone colud have problem:

    **********
    echo '

    ';
    *********

    Right is:
    echo '';

    Robert