Query on Cookbook example
  • Vote Up0Vote Down Daniel JamesDaniel James
    Posts: 844Member, Sourcefabric Team
    Hi devs,

    As Micz is away, would you mind if I asked you a couple of questions
    about Newscoop template syntax?

    In the chapter 'RSS, sitemap, KML and XML', in the section 'Items list',
    this tag doesn't appear to be closed properly:

    <category domain="{{ url options="section" }}</category>

    Further down the page, the complete example shows this code instead:

    <category domain="http://{{ $gimme->publication->site }}/{{
    $gimme->language->code }}/{{ $gimme->issue->number }}/{{
    $gimme->section->url_name }}">{{ $gimme->section->name }}</category>

    which looks more valid to me.

    Also, in the description line above this, the first example uses:

    <description>
    {{
    $gimme->article->intro|strip_tags:false|strip|escape:'html':'utf-8'
    }}&lt;br clear="all"&gt;
    </description>

    whereas the complete example has:

    <description>
    {{
    $gimme->article->intro|strip_tags:false|strip|escape:'html':'utf-8' }}
    </description>

    The escaped <br> tag in the first example seems unnecessary in an RSS
    feed, would you agree?

    Cheers!

    Daniel
  • 2 Comments sorted by
  • Hi Daniel,

    On 3 May 2011 12:12, Daniel James <newscoop-dev@lists.sourcefabric.org> wrote:
    >
    > Hi devs,
    >
    > As Micz is away, would you mind if I asked you a couple of questions
    > about Newscoop template syntax?
    >
    > In the chapter 'RSS, sitemap, KML and XML', in the section 'Items list',
    > this tag doesn't appear to be closed properly:
    >
    > <category domain="{{ url options="section" }}</category>

    oh yes it needs to be properly closed,

    <category domain="{{ url options="section" }}>{{ $gimme->section->name
    }}</category>

    Construction used for creating section url here and further on the
    page would actually return same value, as the second example is
    creating url from elementary particles, while here the same thing is
    done using 'url' command. I think you can use {{ url options="section"
    }} on both places.

    >
    > Further down the page, the complete example shows this code instead:
    >
    > <category domain="http://{{ $gimme->publication->site }}/{{
    > $gimme->language->code }}/{{ $gimme->issue->number }}/{{
    > $gimme->section->url_name }}">{{ $gimme->section->name }}</category>
    >
    > which looks more valid to me.
    >
    > Also, in the description line above this, the first example uses:
    >
    > <description>
    > {{
    > $gimme->article->intro|strip_tags:false|strip|escape:'html':'utf-8'
    > }}&lt;br clear="all"&gt;
    > </description>
    >
    > whereas the complete example has:
    >
    > <description>
    > {{
    > $gimme->article->intro|strip_tags:false|strip|escape:'html':'utf-8' }}
    > </description>
    >
    > The escaped <br> tag in the first example seems unnecessary in an RSS
    > feed, would you agree?

    Sure - for this example 'br' tag is not necessary at all. I would also
    make example code cleaner and simpler.

    >
    > Cheers!
    >
    > Daniel
    >
    --
    Ljuba Rankovic
    Senior Front End Developer, Sourcefabric
    ljuba.rankovic@sourcefabric.org

    http://www.sourcefabric.org
    http://www.twitter.com/Sourcefabric
  • Vote Up0Vote Down Daniel JamesDaniel James
    Posts: 844Member, Sourcefabric Team
    Thanks Smile I've updated this page in the Cookbook.

    Cheers!

    Daniel