Git Product home page Git Product logo

rss_display's Introduction

RSS Display

Display the content elements of the RSS feed on the frontend. The extension is wrapping SimplePie as low level library for fetching and parsing the feed. SimplePie is a fast and well tested library for RSS / Atom. The extension has been almost fully rewritten in 2.0. Make sure to read the migration chapter.

Features:

  • Define various Templates that can be picked by the User.
  • Configurable caching mechanism
  • Advanced View Helper that can extract content from feed items.

Screenshots

In one picture!

https://raw.github.com/fabarea/rss_display/master/Documentation/Manual-01.png

Project info and releases

Stable: http://typo3.org/extensions/repository/view/rss_display

Development: https://github.com/fabarea/rss_display

Installation

Just install the Extension as normal in the Extension Manager and create a content element of type RSS Display.

Users manual

To display a RSS feed on the page : Click on the page where the RSS feed should be displayed and create a new content element.

https://raw.github.com/fabarea/rss_display/master/Documentation/Manual-02.png

Choose the "Plugins" tab and then "RSS Feed Display".

https://raw.github.com/fabarea/rss_display/master/Documentation/Manual-03.png

Write a header if needed ant choose "Plugin" tab.

https://raw.github.com/fabarea/rss_display/master/Documentation/Manual-04.png

In the plugin : 1. Write the feed url 2. Define the number of items to be displayed 3. Tick if the item's description should be displayed 4. If number 3 is ticked, choose the description's length 5. Save and close

https://raw.github.com/fabarea/rss_display/master/Documentation/Manual-05.png

How it should look like on the Frontend.

https://raw.github.com/fabarea/rss_display/master/Documentation/Manual-06.png

Administration

Migration towards 2.0

Extension version 2.0 has been rewritten using Extbase as underlying framework. The database structure was changed. To smooth the migration, run the update wizard from the Extension Manager. The script will take care of building the Flex Form and change the list_type plugin signature.

It is recommended to backup table tt_content!!!

https://raw.github.com/fabarea/rss_display/master/Documentation/Manual-07.png

Plugin type USER_INT vs USER

In the Extension Manager, it can be decided whether to handle the cache by the plugin or by the global cache preferences. This is known to be USER_INT vs USER. If set to USER_INT the default cache duration is 3600 seconds and can be changed by TS. If set to USER the cache is as long as the cache page is configured. Do clear TYPO3 cache when changing this value!!

Avoiding cache

Whenever RSS Display detects the parameter no_cache=1 in the URL, the Caching Framework is skipped. This is convenient in development mode or for forcing the cache to be regenerated.

Add a custom Template

RSS Display is flexible enough to add a custom template which is then display in the drop down menu in the BE. The BE User can then pick this custom template. New template must be added / configured by TypoScript like:

# To be added somewhere in your settings
# Replace "foo" by your extension.
plugin.tx_rssdisplay {
        settings {
                templates {

                        # foo1 is just a key which must be unique
                        foo_1 {
                                label = My Template
                                path = EXT:foo/Resources/Private/Templates/Feed/Show.html
                        }
                }
        }
}

View Helpers

RSS Display has various View Helpers to interact with a SimplePie object which provides an API for fetching data from a feed item. Some advanced View Helpers are explains below

# Retrieve a custom value from the item "author". See the API http://simplepie.org/wiki/reference/start#methods1
<feed:item.get value="author"/>

# Retrieve a value of a custom tag according to a namespace
<feed:item.tag namespace="http://purl.org/dc/elements/1.1/" tag="foo"/>

# Retrieve multiple values from a tag according to a namespace
# The example uses the shorthand syntax of Fluid - @see http://forge.typo3.org/issues/5033
<f:for each="{feed:item.tags(namespace: 'http://purl.org/dc/elements/1.1/' tag: 'bar')}" as="value">
        {value}
</f:for>
{namespace feed=Fab\RssDisplay\ViewHelpers}

Configuration

Property
cacheDuration
Data type
integer
Description
Life time of the cache. The value is relevant only if the extension is a USER_INT which is the default. The extension can also be configured as USER in the Extension Manager.
Default
3600

rss_display's People

Contributors

adrienjacob avatar buepro avatar chesio avatar fabarea avatar humanook avatar iyashi avatar kadamczykmacopedia avatar mabahe avatar mbrodala avatar mh0rst avatar mschwemer avatar namelesscoder avatar patrickpiroth avatar pi-phi avatar pixeldesu avatar powerkiki avatar stephan-tittel avatar stigfaerch avatar sypets avatar wakoch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

rss_display's Issues

Update SimplePie to version 1.5 solved my problem with double-encoded umlauts

The TYPO3 extension rss_display current version 4.0.0 and still uses the old version 1.4-dev of the SimplePie.

As I had problems displaying rss items with german umlauts (like äöüÄÖÜ), they seem to be html-encoded two times, updating the SimplePie library to newest version 1.5 solved the problem.

Simply download the newest version of SimplePie from http://simplepie.org/downloads/, unzip and upload (and overwrite) the content of simplepie-1.5/library/ to your TYPO3 installation into typo3conf/ext/rss_display/Resources/Private/PHP/ . Nothing more todo (I am using TYPO3 8.7).

Please update SimplePie directly in the extension.

Warnings regarding wrong cache directory

By default SimplePie is instanciated with cache = true and cache_location = './cache', which results in a PHP warning as the default directory does not exist in the given context.
Imho it should be the best to use typo3temp or just disable the caching to surpress the warnings...

Warning: ./cache is not writeable. Make sure you've set the correct relative or absolute path, and that the location is server-writable. in /.../typo3conf/ext/rss_display/Resources/Private/PHP/SimplePie/SimplePie.php on line 1379

Editing right

Can you tell me what right settings I have to give so non-administrors can change the plugin settings like number of items and feed URL?
For now only users with administrative rights can!

Thanks a million times!

Eric Thibault

php 7.4: SimplePie\Parse\Date.php raise PHP runtime deprecation notice about implode() arguments

PHP Runtime Deprecation Notice: implode(): Passing glue string after array is deprecated. Swap the parameters in .../typo3conf/ext/rss_display/Resources/Private/PHP/SimplePie/SimplePie/Parse/Date.php line 557

Cited from Typo3 9.5.21 with rss_display 4.4.0 which incorporates SimplePie. I verified that the error still exists in current master branch of SimplePie repository. EDIT: Why I post this issue here instead of at SimplePie's repo, you might wonder? Because it is directly incorporated instead here of only a dependency, I was not sure whom to address.

Wrong Path to SimplePie.php in v11

I had to change the ext_localconf.php in order to load SimplePie.php:

Before:

#61 require sprintf('%sResources/Private/PHP/SimplePie/%s',

After:

#61 require sprintf('%sResources/Private/PHP/SimplePie%s',

registerPlugin should be in EXT:my_extension/Configuration/TCA/Overrides/tt_content, not ext_tables.php

Strange Documentation of GetViewHelper

The documentation in the Readme.md of the GetViewHelper seems to be a bit strange.
The first line should probably be something like this:

# Retrieve a custom value (in this case "author") from the item...

Than the example is a bit useless, as author is a SimplePie-object which will output a hash, when used as in the example. And at least I can not figure out how to get the name of the author. I would appreciate a hint how to do this.

Broken Fluid ViewHelpers

Since Typo3 9.0, method arguments for ViewHelper's render method have been deprecated.

This currently breaks TagsViewHelper and TagViewHelper so that both throw RuntimeExceptions (when using Typo3 in strict mode only?). Proposed fix:

diff --git a/Classes/ViewHelpers/Item/TagViewHelper.php b/Classes/ViewHelpers/Item/TagViewHelper.php
index 9e62a20..a261604 100644
--- a/Classes/ViewHelpers/Item/TagViewHelper.php
+++ b/Classes/ViewHelpers/Item/TagViewHelper.php
@@ -17,6 +17,12 @@ use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
  */
 class TagViewHelper extends AbstractViewHelper
 {
+    public function initializeArguments()
+    {
+        parent::initializeArguments();
+        $this->registerArgument('namespace', 'string', 'RSS element namespace', true);
+        $this->registerArgument('tag', 'string', 'RSS element name', true);
+    }
 
     /**
      * Retrieve the SimplePie item from the context and return its "tag".
@@ -27,12 +33,12 @@ class TagViewHelper extends AbstractViewHelper
      * @return string
      * @throws \TYPO3\CMS\Fluid\Core\ViewHelper\Exception\InvalidVariableException
      */
-    public function render($namespace, $tag)
+    public function render()
     {
 
         /** @var SimplePie_Item $item */
         $item = $this->templateVariableContainer->get('item');
-        $values = $item->get_item_tags($namespace, $tag);
+        $values = $item->get_item_tags($this->arguments['namespace'], $this->arguments['tag']);
 
         $result = '';
         if (is_array($values)) {

and

diff --git a/Classes/ViewHelpers/Item/TagsViewHelper.php b/Classes/ViewHelpers/Item/TagsViewHelper.php
index 756d6dc..debc34e 100644
--- a/Classes/ViewHelpers/Item/TagsViewHelper.php
+++ b/Classes/ViewHelpers/Item/TagsViewHelper.php
@@ -17,21 +17,26 @@ use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
 class TagsViewHelper extends AbstractViewHelper
 {
 
+    public function initializeArguments()
+    {
+        parent::initializeArguments();
+        $this->registerArgument('namespace', 'string', 'RSS element namespace', true);
+        $this->registerArgument('tag', 'string', 'RSS element name', true);
+    }
+
     /**
      * Retrieve the SimplePie item from the context and return its "tags".
      * Example of namespace: http://purl.org/dc/elements/1.1/
      *
-     * @param string $namespace
-     * @param string $tag
      * @return array
      * @throws \TYPO3\CMS\Fluid\Core\ViewHelper\Exception\InvalidVariableException
      */
-    public function render($namespace, $tag)
+    public function render()
     {
 
         /** @var SimplePie_Item $item */
         $item = $this->templateVariableContainer->get('item');
-        $values = $item->get_item_tags($namespace, $tag);
+        $values = $item->get_item_tags($this->arguments['namespace'], $this->arguments['tag']);
 
         $result = array();
         if (is_array($values)) {

Exception upon clearing system cache

When using the extension in TYPO3 8.7.18 and clearing the system cache an exception occures. Deleteing the cache files doesn't help. The issue seems to be related to the cache configuration in ext_localconf.php. When commenting the related lines the cache can be cleared:

// cache configuration, see
// https://docs.typo3.org/typo3cms/...
//$TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['rssdisplay']['frontend']...
//$TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['rssdisplay']['groups']...

The test environment was using the distribution pizpalue which uses the bootstrap_package.

Setting own template by typoscript does not work!

plugin.tx_rssdisplay {
settings {
templates {
rss_display_custom {
label = Angepasstes Template
path = _res/Components/RSSDisplay/Resources/Private/Templates/Feed/Show.html
}
rss_display_1 >
rss_display_2 >
rss_display_3 >
}
}
}

TypoScript is checked in typoscript-object-browser. The settings are shown correct in the object-browser. The content element ignores the settings.

Dirty fix is tho change in the setup.txt in the plugin directory.

Error messages after saving the content elemen

The extension generates an error in the log that occurs quite often.

Core: Error handler (FE): PHP Runtime Deprecation Notice: implode(): Passing glue string after array is deprecated. Swap the parameters in /path/typo3conf/ext/rss_display/Resources/Private/PHP/SimplePie/SimplePie/Parse/Date.php line 558

In addition, an error message is always output when saving:

1: Attempt to modify record '[Kein Titel]' (tt_content:29) without permission. Or non-existing page.

Moving the templates to another location does not work correctly either.

I cannot activate the extension in TYPO3 v10.4 in composer mode

If I do composer req fab/rss-display and then try to activate it through the ExtensionManger, I get the following error message (debug mode):

(1/1) #1519931815 UnexpectedValueException
The package "rss_display" depends on "simplepie/simplepie" which is not present in the system.

As I still need to activate the extension in TYPO3 v10.4, the newest version of this extension seems not to work with TYPO3 version 10.4. My suspicion is that this is a problem with TYPO3 rather than this extension, but you could remove 10.4 version constraint (I did not test this with 11.5)

Tested in TYPO3 Version 10.4.31.

btw as a workaround you could install a lower version (5.1) and than update the extension and this seems to work quite fine, with the exception that you cannot activate or deactivate any extension anymore

[FEATURE] Include SimplePie via composer

As the topic says, I would like to see that SimplePie is also loaded via composer. This makes it easier to switch to newer versions of the library, without touching the extension itself.

I try to come up with a PR.

4.2.0 not working with TYPO3 < 9.5 because of ExtensionConfiguration::class

Bug Report

Summary

There is a class not found exception after updateing rss_display to 4.2.0 on TYPO3 8.7

Steps to reproduce

Update/Install EXT:rss_display 4.2.0 on a TYPO3 versin 8.7.x

What is the current bug behavior?

You get a Class ExtensionConfiguration not found-exception

What is the expected correct behavior?

reading extension-configuration as before

Possible fixes

In FeedController the class ExtensionCofiguration is used in function getPluginType().
This class and the related ExceptionClasses were introduced with TYPO3 v9 and are not available in earlier versions of TYPO3.

One could implement a version-condition to avoid the exception and use the behaviour of rss_display-4.1.0 for earlier Versions of TYPO3.

I will submit a PR with the suggested change

Attempt to modify not existing record

Just installed 5.0.1 first time on my typo3 10.4.15

I have not changed any configuration or registered an own template yet.
Whenever I create a new "general plugin" and select the plugin and press save it seams to be initially saved but each change tries to update an tt_content id which does not exists (actual +1)
rss_display

last entry in my tt_content is:
INSERT INTO tt_content VALUES (1818,294,0,0,0,0,0,0,0,0,1620202012,1620202010,1,0,128,'list','',NULL,0,0,0,2,0,0,0,0,0,NULL,'',0,0,181525,'','','',0,'0','rssdisplay_pi1',1,0,NULL,0,'','',0,0,0,0,0,'\n\n \n <sheet index="sDEF">\n <language index="lDEF">\n <field index="settings.feedUrl">\n <value index="vDEF">http://www.w3.org/blog/news/feed/atom\n \n <field index="settings.numberOfItems">\n <value index="vDEF">10\n \n \n \n \n','',0,'',0,_binary 'a:28:{s:5:"CType";N;s:6:"colPos";N;s:6:"header";N;s:13:"header_layout";N;s:15:"header_position";N;s:4:"date";N;s:11:"header_link";N;s:9:"subheader";N;s:9:"list_type";N;s:11:"pi_flexform";N;s:14:"bg_color_class";N;s:11:"frame_class";N;s:18:"space_before_class";N;s:17:"space_after_class";N;s:17:"padding_top_class";N;s:20:"padding_bottom_class";N;s:7:"effects";N;s:11:"fixed_image";N;s:12:"sectionIndex";N;s:9:"linkToTop";N;s:16:"sys_language_uid";N;s:6:"hidden";N;s:9:"starttime";N;s:7:"endtime";N;s:8:"fe_group";N;s:8:"editlock";N;s:10:"categories";N;s:14:"rowDescription";N;}',NULL,'',0,NULL,0,0,'',NULL,124,0,0,0,0,0,0,0,'','',1,1,1,1,1,'',0,'','','','',0,'',NULL,0,0,'div','','','ascending',NULL,'','','','0',0,0,0,0,'','','','','',0,NULL,'Default',0,'',0,0,'',7);

Any quick idea before I start debugging?

3.0.1 dont work in 6.2.14

Hi, the new Ver. 3.0.1 dont work in the T3 Ver 6.2.14
A white FE and BE page!

plz fix the bug. Thanks!

Question: Use with TypoScript

Very good extension, thank you!

It's not clear to me if and how I can use it with TypoScript. I used kikrssfeeds in this way:

lib.rss2 = COA
lib.rss2{

5 = TEXT
5.value = Header
5.wrap =

|

10 < plugin.tx_kikrssfeeds_pi1
10 {
url = http://...
maxItem = 1
ItemSeparator =
LinkTarget = _blank
ChannelDesc = no
ItemDesc = true
Image = 0
Textinput = no
TitleFile = no
LinkDau = no
LinkAfter = no
HTMLEnt = true
charset = utf-8
}

...

Is there a similar way for rss_display?

Update TYPO3 version dependency to 8

I've been using this extension on a fork for a site running on 8.7 for almost a year and everything has been working perfectly fine.

Mind bumping up the dependency to '7.6.0-8.99.99'?

Question: I got this message TYPO3 10

This is dummy output: Field pi_flexformof table tt_content is registered as type="user" element without a specific renderType. Please look up details in TCA reference documentation for type="user".

Do you have a tip for me on how to solve this quickly?

Best regards
Jules

get image item

Hallo, I have doubt regarding to retrieve the image item. is it possible to have image item in frontend? i mean not only the text, but also image. and how i can call them in template?

with the prev version:
i have adjusted them in template :
<img src="<feed:item.tag namespace="" tag="image"/>" alt="<feed:item.title />">

after i update the newest version, this tag is not longer working. can you please give me a hint? thank you

configurePlugin: class alias can be used for v10 and v11

It is not necessary to check for the TYPO3 version when using class alias in configurePlugin: the class alias can be used for TYPO3 v10 and v11 and the extension is not available for below v10


if ($typo3Version->getMajorVersion() >= 11) {
    \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
        'rss_display',
        'Pi1',
        [\Fab\RssDisplay\Controller\FeedController::class => 'show'],
        $pluginType === 'USER_INT' ? [\Fab\RssDisplay\Controller\FeedController::class => 'show'] : [],
        \TYPO3\CMS\Extbase\Utility\ExtensionUtility::PLUGIN_TYPE_PLUGIN
    );

} else  {
    \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
        'Fab.rss_display',
        'Pi1',
        ['Feed' => 'show'],
        $pluginType === 'USER_INT' ? ['Feed' => 'show'] : []
    );
}

php 7.4 compatibility (SimplePie to 1.5.5)

Upgrading SimplePie to 1.5.5 helped.

but the UpdateScript bails out with:
Call to a member function exec_SELECTgetRows() on null | Error thrown in file typo3temp/var/transient/ext_update21985a820dab12624abf6ea84e5480d6.php in line 33.

        public function updateNewIdentity() {

                $condition = "list_type='rss_display_pi1'";
                $rows = $this->getDatabaseConnection()->exec_SELECTgetRows('*', 'tt_content', $condition);

<pubDate> not working, <lastBuildDate> works

I have 2 Problems:

  1. I have installed tx_news (2.3.1 - TYPO3 6.0) and am trying to get the News with rss_display (3.0.1) on another website (TYPO3 7.6.2).
    If I use the tx_news standard , an old news shows. I cant figure out why.
    If I use the correct news is showing.

  2. I can't use my own Template.
    I have copied the Show.html in fileadmin, corrected the path in TS and changed the template in the plugin.
    Am I doing something wrong or did i forget something?
    plugin.tx_rssdisplay {
    settings {
    templates {
    # foo1 is just a key which must be unique
    foo_1 {
    label = My Template
    path = fileadmin/templates/domain/Show.html
    }
    }
    }
    }

thx for helping ^^

no timeout when fetching feed

If the feed is not responding the fetching-process blocks the entire site. You can reproduce by creating a listening process with nc:

$ nc -l 8000

and setting the feed-url to http://localhost:8000. The site loading finishes after global timeout is hit.
It would be preferable to not block website-loading while fetching the feed.

Sorting

It should be possible to sort items of feed. Currently it is hardcoded - sorting always descending according to date. rss_display\Resources\Private\PHP\SimplePie\SimplePie.php line 2909

Vers. 3(0.1.) Flexform for Template don't show selected item

Hi,

i think i found a bug, since Version 3 can't i save a other template than standard. When i coose a other template, after save is ever choose the first.

I think the problem is in the file \typo3conf\ext\rss_display\Classes\Backend\TceForms.php. The variable "$params" dont give an array back.

With Vers. 2.1.0 can i save the template settings.

Multiple instances of plugin on same page

Adding 2 rss_display instances with different feed rendering templates (from typo3conf/ext/rss_display/Resources/Private/Templates/Feed/) on the same page does not work. Both instances will render with the same template, so one of the instances does not use the configured template.

Typo3: 9.5.4 / rss_display: 4.2.1

Change cache configuration to only override the minimum

If the cache configuration is changed as recommended in the core api (https://docs.typo3.org/typo3cms/CoreApiReference/ApiOverview/CachingFramework/Configuration/Index.html#cache-configurations), it would be possible to set a different backend in LocalConfiguration.php / AddidtionalConfiguration.php. Currently the backend always defaults to the DatabaseBackend. I am not aware of any way to change the defaults. If you change the cache backend for rssdisplay in LocalConfiguration.php this will get overridden by rssdisplay/ext_localconf.php.

What I mean is change this:

$TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['rssdisplay'] = [
    'frontend' => 'TYPO3\CMS\Core\Cache\Frontend\StringFrontend',
//	'options' => array(),
    'groups' => ['all', 'rssdisplay']
];

to somthing like this:

$TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['rssdisplay']['frontend'] = \TYPO3\CMS\Core\Cache\Frontend\StringFrontend::class;
$TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['rssdisplay']['groups'] = array('all', 'rssdisplay');

I can create a pull request.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.