RssWidget
readonly class \
- Implements
- WidgetRendererInterface
Concrete RSS widget implementation
The widget will show a certain number of items of the given RSS feed. The feed will be set by the feedUrl option. You can add a button to the widget by defining a button provider.
The following options are available during registration:
- feedUrl string Defines the URL providing the RSS Feed. This is fetched by the widget in order to show its entries.
- limit int default: 5 Defines how many RSS items should be shown.
- lifetime int default: 43200 Defines how long to wait, in seconds, until fetching RSS Feed again
Tags
Table of Contents
Interfaces
- WidgetRendererInterface
- The WidgetRendererInterface is the (new) base interface for all kind of widgets.
Methods
- __construct() : mixed
- getSettingsDefinitions() : SettingDefinition[]
- renderWidget() : WidgetResult
- This method returns the content of a widget. The returned markup will be delivered by an AJAX call and will not be escaped.
- determineFeedType() : string
- fetchFeedContent() : string
- Feeds are fetched by http(s) only, the hosts can be restricted with $GLOBALS['TYPO3_CONF_VARS']['HTTP']['allowed_hosts']['dashboard_rss'].
- getFeedItems() : array
- getFeedUrl() : string
- A feed url of the widget registration is defined by developers, and is never overridden by the settings of a widget instance.
- isFeedUrlDefinedByWidgetRegistration() : bool
- logFetchError() : void
- parseAtomFeed() : array
- parseRssFeed() : array
- redactFeedUrl() : string
Methods
__construct()
public
__construct(WidgetConfigurationInterface $configuration, FrontendInterface $cache, BackendViewFactory $backendViewFactory[, ButtonProviderInterface|null $buttonProvider = null ][, array $options = [] ]) : mixed
Parameters
- $configuration : WidgetConfigurationInterface
- $cache : FrontendInterface
- $backendViewFactory : BackendViewFactory
- $buttonProvider : ButtonProviderInterface|null = null
- $options : array = []
getSettingsDefinitions()
public
getSettingsDefinitions() : SettingDefinition[]
Return values
SettingDefinition[]renderWidget()
This method returns the content of a widget. The returned markup will be delivered by an AJAX call and will not be escaped.
public
renderWidget(WidgetContext $context) : WidgetResult
Be aware of XSS and ensure that the content is well encoded.
Parameters
- $context : WidgetContext
Return values
WidgetResultdetermineFeedType()
protected
determineFeedType(SimpleXMLElement $feedXml) : string
Parameters
- $feedXml : SimpleXMLElement
Return values
stringfetchFeedContent()
Feeds are fetched by http(s) only, the hosts can be restricted with $GLOBALS['TYPO3_CONF_VARS']['HTTP']['allowed_hosts']['dashboard_rss'].
protected
fetchFeedContent(string $feedUrl) : string
Parameters
- $feedUrl : string
Tags
Return values
stringgetFeedItems()
protected
getFeedItems(SettingsInterface $settings) : array
Parameters
- $settings : SettingsInterface
Tags
Return values
arraygetFeedUrl()
A feed url of the widget registration is defined by developers, and is never overridden by the settings of a widget instance.
protected
getFeedUrl(SettingsInterface $settings) : string
Parameters
- $settings : SettingsInterface
Return values
stringisFeedUrlDefinedByWidgetRegistration()
protected
isFeedUrlDefinedByWidgetRegistration() : bool
Return values
boollogFetchError()
protected
logFetchError(string $feedUrl, Throwable $exception) : void
Parameters
- $feedUrl : string
- $exception : Throwable
parseAtomFeed()
protected
parseAtomFeed(SimpleXMLElement $atomFeed) : array
Parameters
- $atomFeed : SimpleXMLElement
Return values
arrayparseRssFeed()
protected
parseRssFeed(SimpleXMLElement $rssFeed) : array
Parameters
- $rssFeed : SimpleXMLElement
Return values
arrayredactFeedUrl()
protected
redactFeedUrl(string $feedUrl) : string
Parameters
- $feedUrl : string