Quantcast
Channel: Insane in the Main Frame
Viewing all articles
Browse latest Browse all 310

Realurl: define URL for RSS feed

$
0
0

I wanted to add an RSS feed page with certain information about new articles to an existing typo3 project with an active realurl extension. So I started by defining a new type with the number 888 in my extension:

  1. rssarticles = PAGE
  2. rssarticles {
  3. config {
  4. disableAllHeaderCode = 1
  5. xhtml_cleaning = 0
  6. admPanel = 0
  7. additionalHeaders = Content-type:text/xml; charset=utf-8
  8. }
  9. typeNum = 888
  10. 10 = USER
  11. 10 {
  12. extensionName = PackageExtensionname
  13. pluginName = RssNewestArticles
  14. vendorName = Package
  15. userFunc = tx_extbase_core_bootstrap->run
  16. }
  17. }

This was now reachable at http://projekt.de/index.php?type=888&id=33 (the page with the ID 33 being just a normal page invisible in the menu) and it did what it was supposed to do. What I wanted to do now was to make this feed available under http://projekt.de/feed.rss or http://projekt.de/rss/ and, naive as I was, I thought that RealUrl would easily be able to handle this. To my chagrin, I was told that “this should better be done via htaccess, realurl is probably not able to do this”. WHAT? Really?! I thought this was exactly what realurl was supposed to do?
My first try was to define a feed.rss in realurl_conf.php fileName, but for some reason this didn’t allow me to define an ID. Great.
After a long and painful time of searching, I finally decided to settle for a different solution. In the realurl_conf.php I added a type to the preVars:

  1. $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'] = array(
  2. '_DEFAULT' => array(
  3. 'preVars' => array(
  4. array(
  5. 'GETvar' => 'type',
  6. 'valueMap' => array(
  7. 'rss' => 888
  8. ),
  9. 'noMatch' => 'bypass',
  10. 'valueDefault' => 0,
  11. ),
  12. ),
  13. ...

This isn’t enough on its own, because it doesn’t allow the setting of an ID and in my case it resulted in a redirect to the start page. So I added the string of page 33 to my URL. Page 33 was called “new articles” and so I called the page via http://projekt.de/rss/new-articles
This makes realurl recognize that page and set the correct ID.
What I learned from this: realurl sucks and the typo3 “community” is a joke. I found several pages where people asked exactly this and none of the typo3 smartasses bothered to answer.


Viewing all articles
Browse latest Browse all 310

Trending Articles