tt_news

1.7.9. XML feeds from tt_news

To enable your site for serving news as XML-feed, add the static ext-template "News-feed (RSS 0.91, RSS 2 , RDF, Atom 0.3, Atom 1.0)" to your TypoScript setup. This adds a new page-type (100) and configures tt_news with the code "XML", if a page with type=100 is requested.

 


 

 

the other settings for XML feeds can be configured in the constant editor or directly in your TypoScript setup.

 


 

Here's a comparison chart of the required (r), optional (o) and not available (n/a) settings for the different feed formats:

 

rss091

rss2

rdf

atom03

atom1

xmlTitle

r

r

r

r

r

xmlLink

r

r

r

r

o

xmlDesc

r

r

r

o

o

xmlLang

r

o

n/a

o (recommended)

n/a

xmlIcon

r

o

o (must be 88x31px)

n/a

n/a

 

 

If you want to include the settings by TS � Here's the code:

  # Configure tt_news to display the xml template 
  plugin.tt_news {
    displayXML {
      # rss091_tmplFile = EXT:tt_news/res/rss_0_91.tmpl
      # rdf_tmplFile = EXT:tt_news/res/rdf.tmpl
      # atom03_tmplFile = EXT:tt_news/res/atom_0_3.tmpl
      # atom1_tmplFile = EXT:tt_news/res/atom_1_0.tmpl
      rss2_tmplFile = EXT:tt_news/res/rss_2.tmpl

      # possibile values: rss091 / rss2 / rdf / atom03 / atom1
      xmlFormat = rss2

      xmlTitle = example.com: Latest News
      xmlLink = http://example.com/
      xmlDesc = Latest News
      xmlLang = en
      xmlIcon = fileadmin/tt_news_article.gif
      title_stdWrap.htmlSpecialChars = 1
      title_stdWrap.htmlSpecialChars.preserveEntities = 1
      subheader_stdWrap.stripHtml = 1
      subheader_stdWrap.htmlSpecialChars = 1
      subheader_stdWrap.htmlSpecialChars.preserveEntities = 1
      subheader_stdWrap.crop = 100 | ... | 1
      subheader_stdWrap.ifEmpty.field = bodytext
      xmlLastBuildDate = 1
    }
  }


  ## This enables the xml news feed
  xmlnews = PAGE
  xmlnews {
    typeNum = 100

    10 >
    10 < plugin.tt_news
    10.pid_list >
    10.pid_list = {$plugin.tt_news.pid_list}
    10.singlePid = {$plugin.tt_news.singlePid}
    10.defaultCode = XML

    config {
      disableAllHeaderCode = 1
      additionalHeaders = Content-type:text/xml
      no_cache = 1
      xhtml_cleaning = 0
    }
  }
  ## To get an additional RDF feed add the following rdffeed = PAGE
rdffeed < xmlnews rdffeed {
10.displayXML.xmlFormat = rdf
10.displayXML.xmlIcon = fileadmin/feed_icon_88x31.gif
typeNum = 101
}
## To get an additional Atom 0.3 feed add the following atom03feed = PAGE
atom03feed < xmlnews atom03feed {
10.displayXML.xmlFormat = atom03
typeNum = 102
}
  ## To get an additional Atom 1.0 feed add the following
atom1feed = PAGE
atom1feed < xmlnews atom1feed {
10.displayXML.xmlFormat = atom1
typeNum = 103
}

Hint:
if you add the line below to the header of your site, browsers will detect this site as a RSS-source. (f.e. Firefox 1 with the nice "Add life bookmarks" feature)

  <link rel="alternate" type="application/rss+xml" title="RSS-Feed" 
  href="http://my-server.org/index.php?id=5&type=100">

More information:

RSS 0.91 specification: http://my.netscape.com/publish/formats/rss-spec-0.91.html

RSS 2.0 specification: http://blogs.law.harvard.edu/tech/rss

RDF specification: http://web.resource.org/rss/1.0/spec / http://www.w3.org/TR/rdf-syntax-grammar/

Atom 0.3 specification: http://www.atomenabled.org/developers/syndication/atom-format-spec.php

Atom 1.0 specification: http://www.atomenabled.org/developers/syndication/

 

To top


Valid XHTML 1.0!