### Example how to migrate realurl alias Source: https://github.com/georgringer/news/blob/main/Documentation/Misc/Changelog/6-1-0.rst This documentation entry provides an example for migrating realurl aliases. ```gitcommit 2017-08-08 [DOC] Example how to migrate realurl alias (Commit 89e418f by Georg Ringer) ``` -------------------------------- ### Install rx_shariff Extension Source: https://github.com/georgringer/news/blob/main/Documentation/Reference/TypoScript/GeneralSettings.rst Install the rx_shariff extension using composer to enable social sharing functionality. This is required if 'detail.showSocialShareButtons' is enabled. ```bash composer req reelworx/rx-shariff ``` -------------------------------- ### Example of Category Menu with TS Source: https://github.com/georgringer/news/blob/main/Documentation/Misc/Changelog/6-1-0.rst This is an example of how to configure a category menu using TypoScript. ```typoscript example of category menu with TS ``` -------------------------------- ### Redirect to page on start Source: https://github.com/georgringer/news/blob/main/Documentation/Reference/TsConfig/Administration.rst Redirect the user to a specific page if no page is selected in the page tree. ```typoscript # Example: tx_news.module.redirectToPageOnStart = 456 ``` -------------------------------- ### Basic Route Enhancer Configuration Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/BestPractice/Routing/Index.rst A minimal configuration example for routing the news detail view using a custom path segment. ```yaml routeEnhancers: News: type: Extbase extension: News plugin: Pi1 routes: - routePath: '/article/{news-title}' _controller: 'News::detail' _arguments: news-title: news aspects: news-title: type: NewsTitle ``` -------------------------------- ### Setup Language Menu for News Detail Pages Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/BestPractice/Seo/Index.rst Configure a language menu in TypoScript for news detail pages. This setup ensures the menu is correctly rendered and includes query string parameters if necessary. ```typoscript 10 = language-menu 10 { as = languageMenu addQueryString = 1 } 11 = disable-language-menu # comma separated list of language menu names 11.menus = languageMenu ``` -------------------------------- ### Install News Extension with Composer Source: https://github.com/georgringer/news/blob/main/Documentation/Administration/Installation/Index.rst Use this Composer command to add the News extension to your TYPO3 installation. Ensure you are in your TYPO3 project root directory. ```bash composer require georgringer/news ``` -------------------------------- ### Configuration via settings.yaml Source: https://github.com/georgringer/news/blob/main/Documentation/Reference/SiteSets/Index.rst The configuration for site sets is persisted in the site's settings.yaml file. Below are the available configuration keys for the Basic Setup and Record Links sets. ```APIDOC ## Configuration Settings (settings.yaml) ### Description Settings for the EXT:news extension are managed through Site-Sets and stored in `/config/sites//settings.yaml`. ### Basic Setup Settings - **news.view.templateRootPath** (string) - Path to the templates. - **news.view.partialRootPath** (string) - Path to the partials. - **news.view.layoutRootPath** (string) - Path to the layouts. - **news.pages.detail** (page) - Page with detail view for news records. - **news.preview.page** (page) - Page with detail plugin used for previews. - **news.preview.mode** (enum) - Either 'news' or 'news_preview'. ### Record Links Settings - **news.recordLinks.label** (string) - Required - The label used in the Link Browser. - **news.recordLinks.storagePid** (page) - The link browser starts with the given page. - **news.recordLinks.hidePageTree** (bool) - Hide the page tree in the link browser. - **news.recordLinks.detail** (page) - Required - Detail page used for the link. ### Example Configuration ```yaml news: view: templateRootPath: "EXT:news/Resources/Private/Templates/" recordLinks: label: "News Records" detail: 123 ``` ``` -------------------------------- ### Using a News Extension ViewHelper Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/Templates/ViewHelpers/Index.rst Once the namespace for the News extension ('n') is declared, you can use its ViewHelpers directly. This example shows how to call the 'headerData' ViewHelper. ```html ``` -------------------------------- ### TypoScript Setup for Multiple Template Path Fallbacks Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/Templates/Start/Index.rst Configure multiple fallback paths for templates, partials, and layouts using TypoScript setup. This allows for a layered approach to template overriding, ensuring your site package templates are prioritized. ```typoscript plugin.tx_news { view { templateRootPaths > templateRootPaths { 0 = EXT:news/Resources/Private/Templates/ 10 = EXT:mynewsextender/Resources/Private/Templates/ 15 = EXT:myothernewsextender/Resources/Private/Templates/ 20 = {$plugin.tx_news.view.templateRootPath} } partialRootPaths > partialRootPaths { 0 = EXT:news/Resources/Private/Partials/ 10 = EXT:mynewsextender/Resources/Private/Partials/ 15 = EXT:myothernewsextender/Resources/Private/Partials/ 20 = {$plugin.tx_news.view.partialRootPath} } layoutRootPaths > layoutRootPaths { 0 = EXT:news/Resources/Private/Layouts/ 10 = EXT:mynewsextender/Resources/Private/Layouts/ 15 = EXT:myothernewsextender/Resources/Private/Layouts/ 20 = {$plugin.tx_news.view.layoutRootPath} } } } ``` -------------------------------- ### Add Missing Inject Annotation in Example Source: https://github.com/georgringer/news/blob/main/Documentation/Misc/Changelog/6-1-0.rst This documentation entry adds a missing inject annotation in an example. ```gitcommit 2017-07-25 [DOC] Add missing inject annotation in example (Commit cf70cf9 by Georg Ringer) ``` -------------------------------- ### Simplify Routing Configuration (YAML) Source: https://github.com/georgringer/news/blob/main/Documentation/Misc/Changelog/11-0-0.rst This YAML configuration shows the simplified routing setup for the news extension, replacing the older PersistedAliasMapper with a NewsTitle aspect. ```yaml # before aspects: news-title: type: PersistedAliasMapper tableName: tx_news_domain_model_news routeFieldName: path_segment # now aspects: news-title: type: NewsTitle ``` -------------------------------- ### Comprehensive Route Enhancer Configuration Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/BestPractice/Routing/Index.rst A full configuration example including support for pagination, category filtering, tag filtering, and detail views. Note that the order of routes is critical for correct resolution. ```yaml routeEnhancers: News: type: Extbase extension: News plugin: Pi1 routes: - routePath: '/' _controller: 'News::list' # Pagination - routePath: '/page-{page}' _controller: 'News::list' _arguments: page: 'currentPage' # Category + pagination: - routePath: '/category/{category-name}/page-{page}' _controller: 'News::list' _arguments: category-name: overwriteDemand/categories page: 'currentPage' # Category - routePath: '/category/{category-name}' _controller: 'News::list' _arguments: category-name: overwriteDemand/categories # Tagname + pagination - routePath: '/tag/{tag-name}/page-{page}' _controller: 'News::list' _arguments: tag-name: overwriteDemand/tags page: 'currentPage' # Tagname - routePath: '/tag/{tag-name}' _controller: 'News::list' _arguments: tag-name: overwriteDemand/tags # Detail - routePath: '/article/{news-title}' _controller: 'News::detail' _arguments: news-title: news defaultController: 'News::list' defaults: page: '0' aspects: news-title: type: NewsTitle page: type: StaticRangeMapper start: '1' end: '100' category-name: type: NewsCategory tag-name: type: NewsTag PageTypeSuffix: type: PageType map: 'feed.xml': 9818 'calendar.ical': 9819 ``` -------------------------------- ### TypoScript Setup for Pagination Widget Template Path Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/Templates/Start/Index.rst Customize the template path for the pagination widget specifically by configuring the GeorgRinger\News\ViewHelpers\Widget\PaginateViewHelper in your TypoScript setup. ```typoscript plugin.tx_news { view { widget.GeorgRinger\News\ViewHelpers\Widget\PaginateViewHelper { templateRootPath = EXT:mysitepackage/Resources/Private/Extensions/News/Templates/ ``` -------------------------------- ### Configure Multiple Sitemaps for TYPO3 News Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/BestPractice/Seo/Index.rst Define multiple sitemaps, including one for Google News, by extending the plugin.tx_seo configuration. This example sets up a news sitemap and a specific configuration for Google News. ```typoscript plugin.tx_seo { config { xmlSitemap { sitemaps { news { provider = GeorgRinger\News\Seo\NewsXmlSitemapDataProvider config { # ... } } } } googleNewsSitemap { sitemaps { news < plugin.tx_seo.config.xmlSitemap.sitemaps.news news { config { template = EXT:news/Resources/Private/Templates/News/GoogleNews.xml googleNews = 1 } } } } } } seo_sitemap_news < seo_sitemap seo_sitemap_news { typeNum = 1533906436 10.sitemapType = googleNewsSitemap } ``` -------------------------------- ### Display list and detail views on the same page Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/BestPractice/IntegrationWithTypoScript/Index.rst Configure separate list and detail objects and use a condition to toggle between them based on GET parameters. ```typoscript # Basic plugin settings lib.news = USER lib.news { userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run pluginName = Pi1 vendorName = GeorgRinger extensionName = News controller = News settings =< plugin.tx_news.settings persistence =< plugin.tx_news.persistence view =< plugin.tx_news.view } ``` ```typoscript lib.news_list < lib.news lib.news_list { # Use the line below to sue the sticky list # pluginName = NewsListSticky } lib.news_detail < lib.news lib.news_detail { pluginName = NewsDetail } ``` ```typoscript [traverse(request.getQueryParams(), 'tx_news_pi1/news') > 0] page.10.marks.content < lib.news_detail [else] page.10.marks.content < lib.news_list [end] ``` -------------------------------- ### Configure RSS Feed Template Path Source: https://github.com/georgringer/news/blob/main/Documentation/Misc/Changelog/8-3-0.rst Use this TypoScript to set the template root path for fluid_styled_content to simplify RSS feed setup. ```typoscript lib.contentElement.templateRootPaths.5 = EXT:news/Resources/Private/Examples/Rss/fluid_styled_content/Templates ``` -------------------------------- ### Configure PSR-4 autoloading in composer.json Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/ExtendNews/ExtensionBasedOnNews/Index.rst Required for composer-based installations to locate extension classes. ```js "autoload": { "psr-4": { "GeorgRinger\\NewsFilter\\": "path/to/news_filter/Classes/" } } ``` -------------------------------- ### Example NewsListActionEvent Listener Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/ExtendNews/Events/Index.rst Implement a listener for the NewsListActionEvent to access and modify assigned values before they are used. ```php getAssignedValues(); // Do some stuff $event->setAssignedValues($values); } } ``` -------------------------------- ### Declaring Namespaces for Extensions Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/Templates/ViewHelpers/Index.rst To use ViewHelpers from other extensions, declare their namespaces at the beginning of your template. This example shows declarations for Fluid, the News extension, and a custom extension. ```html ... ``` -------------------------------- ### Configure RSS Feed via Plugin and TypoScript Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/BestPractice/Rss/Index.rst Setup for generating an RSS feed using the news plugin. This involves backend configuration for the plugin and specific TypoScript settings to ensure correct XML output and absolute URLs. ```typoscript page = PAGE page.10 < styles.content.get config { # deactivate Standard-Header disableAllHeaderCode = 1 # no xhtml tags xhtml_cleaning = none admPanel = 0 # define charset metaCharset = utf-8 additionalHeaders.10.header = Content-Type:application/rss+xml;charset=utf-8 disablePrefixComment = 1 linkVars > } # set the format plugin.tx_news.settings.format = xml # delete content wrap tt_content.stdWrap > tt_content.stdWrap.editPanel = 0 # Use custom template for List.html of EXT:fluid_styled_content lib.contentElement.templateRootPaths.5 = EXT:news/Resources/Private/Examples/Rss/fluid_styled_content/Templates ``` -------------------------------- ### Configure Lazy Loading for Images Source: https://github.com/georgringer/news/blob/main/Documentation/Misc/Changelog/9-1-0.rst Use this TypoScript configuration to enable lazy loading for news list and detail views. If EXT:fluid_styled_content is not installed, manual configuration is required. ```typoscript plugin.tx_news.settings { list.media.image.lazyLoading = {$styles.content.image.lazyLoading} detail.media.image.lazyLoading = {$styles.content.image.lazyLoading} } ``` -------------------------------- ### Conditional Template Rendering in Fluid Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/Templates/TemplateSelector/Index.rst This Fluid template example demonstrates how to conditionally render different HTML structures based on the 'settings.templateLayout' value. It also shows how to load specific partials for different layouts. ```html
``` -------------------------------- ### Add simple ext:linkhandler sample configuration Source: https://github.com/georgringer/news/blob/main/Documentation/Misc/Changelog/3-1-0.rst Provides a sample configuration for ext:linkhandler, demonstrating how to integrate it with the News extension for handling links. ```typoscript tx_news { linkhandler { news { name = News action = detail # Example for a page with news list pageId = 123 # Example for a news record record = TEXT record.field = uid record.insertData = 1 # Example for a news category category = TEXT category.field = categories category.insertData = 1 } } } ``` -------------------------------- ### Get Tag Usage Count with ViewHelper Source: https://github.com/georgringer/news/blob/main/Documentation/Misc/Changelog/7-0-0.rst This Fluid ViewHelper example demonstrates how to retrieve the count of system-wide usage for a given tag. The result is stored in a template variable named 'tagUsageCount'. ```html {n:tag.count(tagUid:tag.uid) -> f:variable(name: 'tagUsageCount')} ``` -------------------------------- ### Access Page Data in Fluid Templates Source: https://github.com/georgringer/news/blob/main/Documentation/Misc/Changelog/6-1-0.rst In frontend Fluid templates, access the current page's full row data using the `pageData` variable. For example, get the page title with `pageData.title`. ```fluid {pageData.title} ``` -------------------------------- ### TypoScript Configuration for iCalendar Feed Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/BestPractice/ICalendar/Index.rst This TypoScript setup generates an iCalendar feed for news. It configures page type, content element settings, and headers for a text/calendar content type. It filters news by category and starting point. ```typoscript [getTSFE() && getTSFE().type == 9819] config { disableAllHeaderCode = 1 xhtml_cleaning = none admPanel = 0 metaCharset = utf-8 # For 7 LTS additionalHeaders = Content-Type:text/calendar;charset=utf-8 # Since 8 LTS additionalHeaders.10.header = Content-Type:text/calendar;charset=utf-8 disablePrefixComment = 1 linkVars > } pageNewsICalendar = PAGE pageNewsICalendar { typeNum = 9819 10 < tt_content.news_pi1.20 10 { settings < plugin.tx_news.settings settings { categories = 9 categoryConjunction = notor limit = 30 detailPid = 25 startingpoint = 24 format = ical domain.data = getEnv:HTTP_HOST useStdWrap = domain } } } [END] ``` -------------------------------- ### Configure EXT:news via AdditionalConfiguration.php Source: https://github.com/georgringer/news/blob/main/Documentation/Reference/ExtensionConfiguration/Index.rst Define extension settings in AdditionalConfiguration.php to manage them within version control instead of using the TYPO3 Admin Tools. ```php $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['news'] = [ 'advancedMediaPreview' => '1', 'archiveDate' => 'date', 'categoryBeGroupTceFormsRestriction' => '0', 'categoryRestriction' => 'none', 'contentElementRelation' => '1', 'dateTimeNotRequired' => '0', 'hidePageTreeForAdministrationModule' => '0', 'manualSorting' => '0', 'prependAtCopy' => '1', 'resourceFolderImporter' => '/news_import', 'rteForTeaser' => '0', 'showAdministrationModule' => '1', 'slugBehaviour' => 'unique', 'storageUidImporter' => '1', 'tagPid' => '1', ]; ``` -------------------------------- ### Define extension configuration in ext_emconf.php Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/ExtendNews/ProxyClassGenerator/Index.rst Basic metadata and dependency constraints for the extension. ```php 'news events', 'description' => 'Events for news', 'category' => 'plugin', 'author' => 'Georg Ringer', 'author_email' => '', 'state' => 'alpha', 'uploadfolder' => false, 'createDirs' => '', 'clearCacheOnLoad' => true, 'version' => '1.0.0', 'constraints' => [ 'depends' => [ 'typo3' => '7.6.13-8.7.99', 'news' => '6.2.0-6.9.99', ], 'conflicts' => [], 'suggests' => [], ], ]; ``` -------------------------------- ### Configure Dummy Image Path Source: https://github.com/georgringer/news/blob/main/Documentation/Reference/TypoScript/GeneralSettings.rst Set the path to the placeholder image to be displayed when no preview image is available. This is a string value. ```typoscript plugin.tx_news.settings.list.media.dummyImage = EXT:my_sitepackage/Resources/Public/Images/News/MyPreviewImage.png ``` -------------------------------- ### Execute CLI Import Source: https://github.com/georgringer/news/blob/main/Documentation/Misc/Changelog/5-3-0.rst Run the news import process from the command line using the TYPO3 CLI dispatcher. ```bash ./typo3/cli_dispatch.phpsh extbase newsimport:run ``` -------------------------------- ### General Settings Source: https://github.com/georgringer/news/blob/main/Documentation/Reference/TypoScript/GeneralSettings.rst All settings need to be prefixed with plugin.tx_news.settings. ```APIDOC ## General Settings Any setting needs to be prefixed with :typoscript:`plugin.tx_news.settings.` ``` -------------------------------- ### Configure plugin in ext_localconf.php Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/ExtendNews/ExtensionBasedOnNews/Index.rst Registers the plugin and its list action within the Extbase framework. ```php 'list', ] ); }; $boot(); unset($boot); ``` -------------------------------- ### Integrate EXT:news via TypoScript Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/BestPractice/IntegrationWithTypoScript/Index.rst Use this configuration to manually instantiate the news plugin within TypoScript. ```typoscript lib.news = USER lib.news { userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run extensionName = News pluginName = Pi1 vendorName = GeorgRinger settings < plugin.tx_news.settings settings { //categories = 49 limit = 30 detailPid = 31 overrideFlexformSettingsIfEmpty := addToList(detailPid) startingpoint = 13 } } ``` -------------------------------- ### NewsControllerOverrideSettingsEvent Listener Example Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/ExtendNews/Events/Index.rst Implement a listener for NewsControllerOverrideSettingsEvent to modify controller settings, such as changing the category selection. ```php getSettings(); $settings['categories'] = '2,3'; $event->setSettings($settings); } } ``` -------------------------------- ### Define Custom FlexForm XML Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/ExtendNews/ExtendFlexforms/Index.rst Example structure for an additional FlexForm file compatible with TYPO3 12 LTS+. ```html Fo array input 2 int 3 ``` -------------------------------- ### ModifyDemandRepositoryEvent Listener Example Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/ExtendNews/Events/Index.rst Implement a listener for ModifyDemandRepositoryEvent to alter the query constraints, for instance, to filter news by title. ```php getConstraints(); $constraints[] = $query->like('title', '%' . $subject . '%'); $event->setConstraints($constraints); } } ``` -------------------------------- ### Initialize FlexForm configuration in tt_content.php Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/ExtendNews/ExtensionBasedOnNews/Index.rst Placeholder for FlexForm registration in the plugin override file. ```php f:format.bytes()} ``` -------------------------------- ### Restrict Categories with PageTsConfig Source: https://github.com/georgringer/news/blob/main/Documentation/Reference/ExtensionConfiguration/Index.rst Set a PageTsConfig value to restrict the available categories in news records. This example sets the PAGE_TSCONFIG_IDLIST to 120. ```t3config TCEFORM.tx_news_domain_model_news.categories.PAGE_TSCONFIG_IDLIST=120. ``` -------------------------------- ### Configure Detail Media Image Settings Source: https://github.com/georgringer/news/blob/main/Documentation/Reference/TypoScript/GeneralSettings.rst Configure media elements for the detail view, specifically for images. This includes setting maximum width and height. Options for lightbox integration are also provided, with different configurations for fluid_styled_content and css_styled_content. ```typoscript detail.media { image { maxWidth = 282 maxHeight = # If using fluid_styled_content lightbox { enabled = {$styles.content.textmedia.linkWrap.lightboxEnabled} class = {$styles.content.textmedia.linkWrap.lightboxCssClass} width = {$styles.content.textmedia.linkWrap.width} height = {$styles.content.textmedia.linkWrap.height} } # If using css_styled_content, use those settings # lightbox { # enabled = {$styles.content.imgtext.linkWrap.lightboxEnabled} # class = {$styles.content.imgtext.linkWrap.lightboxCssClass} # width = {$styles.content.imgtext.linkWrap.width} # height = {$styles.content.imgtext.linkWrap.height} # rel = lightbox[myImageSet] # } } video { width = 282 height = 300 } } ``` -------------------------------- ### Hardcode demand object configuration Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/ExtendNews/ExtensionBasedOnNews/Index.rst Demonstrates how to filter news records by storage page, author, and excluded IDs. ```php protected function createDemandObject(): NewsDemand { $demand = new NewsDemand(); $demand->setStoragePage('123'); $demand->setAuthor('John'); $demand->setHideIdList('12,45'); return $demand; } ``` -------------------------------- ### Remove Option from Select Field Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/BestPractice/PredefineFields/Index.rst Use TCEFORM to remove specific options from select fields. This example removes the 'Images' option from the media selection dropdown. ```typoscript TCEFORM.tx_news_domain_model_media { type.removeItems = 0 } ``` -------------------------------- ### Define extension configuration in ext_emconf.php Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/ExtendNews/ExtensionBasedOnNews/Index.rst Contains basic metadata and constraints for the TYPO3 extension. ```php 'News Filter', 'description' => 'News filtering', 'category' => 'fe', 'author' => 'John Doe', 'author_email' => 'john@doe.net', 'author_company' => '', 'state' => 'stable', 'uploadfolder' => 0, 'clearCacheOnLoad' => 1, 'version' => '1.0.0', 'constraints' => [ 'depends' => [ 'typo3' => '7.6.0-8.9.99', ], 'conflicts' => [], 'suggests' => [], ], ]; ``` -------------------------------- ### Implement Multi-Category Filtering Links Source: https://github.com/georgringer/news/blob/main/Documentation/Misc/Changelog/7-0-0.rst Use the multiCategoryLink ViewHelpers to toggle category selection states and generate appropriate filter links. ```html dazu dazu ``` -------------------------------- ### Preselect Value in a Select Field Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/BestPractice/PredefineFields/Index.rst To preselect a value in a select field, set the option's value in TSconfig. This example preselects the language with UID 3. ```typoscript TCAdefaults.tx_news_domain_model_news { sys_language_uid = 3 } ``` -------------------------------- ### Generate git log for release notes Source: https://github.com/georgringer/news/blob/main/Documentation/Misc/Changelog/6-3-0.rst Command used to generate the list of changes for the release notes. ```bash git log 6.2.1..HEAD --abbrev-commit --pretty='%ad %s (Commit %h by %an)' --date=short ``` -------------------------------- ### Add Route Enhancers Section Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/BestPractice/Routing/Index.rst This snippet shows the basic structure for adding a route enhancer. It's a starting point before defining specific routes and aspects. ```yaml routeEnhancers: News: type: Extbase extension: News plugin: Pi1 # routes and aspects will follow here ``` -------------------------------- ### Override Pagination Labels with TypoScript Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/Templates/Snippets/Index.rst Customize pagination labels using TypoScript. This example shows how to set a custom 'next' label for the default language and for German ('de'). ```typoscript plugin.tx_fluid { _LOCAL_LANG { // default for default = english language default { widget.pagination.next = my custom next } de { widget.pagination.next = nächste Seite } } } ``` -------------------------------- ### Configure Proxy Class Generation Source: https://github.com/georgringer/news/blob/main/Documentation/Misc/Changelog/3-2-0.rst Add this code to your ext_localconf.php to register custom classes for EXT:news. Ensure the class path is correctly specified. ```php ``` -------------------------------- ### Modify Flexform Values Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/BestPractice/PredefineFields/Index.rst Modify flexform values using TSconfig. This example disables the 'orderDirection' setting and adds 'teaser' as an option for 'orderBy' in the news pi1 flexform. ```typoscript TCEFORM { tt_content { pi_flexform { news_pi1 { sDEF { settings\.orderDirection.disabled = 1 settings\.orderBy.addItems { teaser = teaser } } } } } } ``` -------------------------------- ### Configure News for iCalendar Output Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/BestPractice/ICalendar/Index.rst Set the news plugin to format content as iCalendar and specify the domain for unique UIDs. This configuration is typically placed in the TypoScript setup. ```typoscript plugin.tx_news.settings.format = ical # set the domain for real unique uids plugin.tx_news.settings.domain.data = getEnv:HTTP_HOST plugin.tx_news.settings.useStdWrap = domain # delete content wrap tt_content.stdWrap > ``` -------------------------------- ### Migrate plugins via CLI Source: https://github.com/georgringer/news/blob/main/Documentation/Administration/Migration/MigrationFromTtNews/Index.rst Use these commands to migrate tt_news plugins to EXT:news and remove the old plugins. ```bash ./typo3/cli_dispatch.phpsh extbase ttnewspluginmigrate:run ./typo3/cli_dispatch.phpsh extbase ttnewspluginmigrate:removeOldPlugins ``` -------------------------------- ### Configure Optional Namespaces for Plugins (TypoScript) Source: https://github.com/georgringer/news/blob/main/Documentation/Misc/Changelog/11-0-0.rst This TypoScript configuration demonstrates how to set custom namespaces for various news plugins, allowing for more independent configuration. ```typoscript plugin { tx_news_newsliststicky.settings { myCustomSetting = 1 } tx_news_newsdetail.settings {} tx_news_newsselectedlist.settings {} tx_news_newsdatemenu.settings {} tx_news_categorylist.settings {} tx_news_newssearchform.settings {} tx_news_newssearchresult.settings {} tx_news_taglist.settings {} } ``` -------------------------------- ### Improve createDemandObjectFromSettings Source: https://github.com/georgringer/news/blob/main/Documentation/Misc/Changelog/3-1-0.rst Optimizes the 'createDemandObjectFromSettings' method, likely by improving its efficiency or handling of various settings. ```php protected function createDemandObjectFromSettings(array $settings) { $demand = new Tx_News_Domain_Model_Demand(); // ... improved logic for populating demand object from settings ... return $demand; } ``` -------------------------------- ### MediaFactoryViewHelper Source: https://github.com/georgringer/news/blob/main/Documentation/Reference/ViewHelpers/MediaFactoryViewHelper.rst ViewHelper to show videos with configurable dimensions and CSS classes. ```APIDOC ## MediaFactoryViewHelper ### Description ViewHelper to show videos. ### Parameters - **classes** (string) - Optional - List of classes which are used to render the media object. - **element** (Tx_News_Domain_Model_Media) - Required - Current media object. - **height** (integer) - Optional - Height of the media object. - **width** (integer) - Optional - Width of the media object. ``` -------------------------------- ### Clear Cache Command in PageTsConfig Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/BestPractice/ClearCache/Index.rst Use this command in PageTsConfig to manually clear specific page caches when news records are edited. Adjust page IDs to match your setup. ```typoscript TCEMAIN.clearCacheCmd = 123,456,789 ``` -------------------------------- ### Conditional Rendering in Page Template with PAGEVIEW Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/BestPractice/HideDetailPage/Index.rst Modify your page template to conditionally render content based on the `isDetail` variable. This example shows how to render only the news plugin in detail view. ```html ``` -------------------------------- ### Create links with Fluid Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/Templates/Snippets/Index.rst Demonstrates generating links to news detail pages using both the f:link.page ViewHelper and standard HTML anchor tags. ```html {newsItem.title} {newsItem.title} ``` -------------------------------- ### TypoScript Breadcrumb Menu Configuration (Legacy) Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/BestPractice/BreadcrumbMenu.rst Configure a breadcrumb menu using TypoScript. This example includes a standard rootline menu and adds the news title if on a single news view. ```typoscript lib.navigation_breadcrumb = COA lib.navigation_breadcrumb { stdWrap.wrap = 10 = HMENU 10 { special = rootline #special.range = 1 1 = TMENU 1 { NO = 1 NO { wrapItemAndSub =
  • |
  • ATagTitle.field = subtitle // title stdWrap.htmlSpecialChars = 1 } CUR <.NO CUR { wrapItemAndSub =
  • |
  • doNotLinkIt = 1 } } } # Add news title if on single view 20 = RECORDS 20 { stdWrap.if.isTrue.data = GP:tx_news_pi1|news dontCheckPid = 1 tables = tx_news_domain_model_news ``` -------------------------------- ### Render restricted news with ViewHelper Source: https://github.com/georgringer/news/blob/main/Documentation/Addons/NewsFegroupPreview/Index.rst Use the security.defaultVisible ViewHelper to check if a news record should be displayed fully or as a teaser with a login link. ```html {newsItem.title} {newsItem.title} Login to read all ``` -------------------------------- ### Render news items in columns using ChunkViewHelper Source: https://github.com/georgringer/news/blob/main/Documentation/Misc/Changelog/8-1-0.rst Use the iterator.chunk ViewHelper to group news items into columns for grid layouts. ```html
    ``` -------------------------------- ### Configure Routing for iCalendar Feed URL Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/BestPractice/ICalendar/Index.rst Rewrite the URL for the iCalendar feed using TypoScript route enhancers. This example maps a URL path to a specific page type for the iCalendar feed. ```yaml routeEnhancers: News: PageTypeSuffix: type: PageType map: 'feed.xml': 9818 'calendar.ical': 9819 ``` -------------------------------- ### Default List Media Configuration Source: https://github.com/georgringer/news/blob/main/Documentation/Reference/TypoScript/GeneralSettings.rst Default configuration for media elements in the list view. Adjust 'maxWidth' and 'maxHeight' as needed. Customization may require template modifications. ```typoscript list.media { image { maxWidth = 100 maxHeight = 100 } } ``` -------------------------------- ### Configure Basic XML Sitemap Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/BestPractice/Seo/Index.rst Uses the core RecordsXmlSitemapDataProvider to include news records in the XML sitemap. ```typoscript plugin.tx_seo.config { xmlSitemap { sitemaps { news { provider = TYPO3\CMS\Seo\XmlSitemap\RecordsXmlSitemapDataProvider config { table = tx_news_domain_model_news # exclude internal & external news additionalWhere = {#type} NOT IN(1,2) sortField = sorting lastModifiedField = tstamp changeFreqField = sitemap_changefreq priorityField = sitemap_priority pid = 26 recursive = 2 url { pageId = 25 fieldToParameterMap { uid = tx_news_pi1[news] } additionalGetParameters { tx_news_pi1.controller = News tx_news_pi1.action = detail } } } } } } } ``` -------------------------------- ### Configure AddNewsToMenuProcessor in TypoScript Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/ExtendNews/DataProcessing/AddNewsToMenuProcessor.rst Use this configuration to attach the current news record to specified menu processors. Ensure the referenced menus are defined elsewhere in the TypoScript configuration. ```typoscript 10 = menu 10 { as = breadcrumbMenu special = rootline # [...] further configuration } 20 = add-news-to-menu 20.menus = breadcrumbMenu,specialMenu ``` -------------------------------- ### Include Multiple Tables for Cache Expiration Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/BestPractice/ClearCache/Index.rst This TypoScript configuration allows specifying multiple tables and their respective storage folder UIDs for cache expiration on a single page. This example includes news records and categories. ```typoscript config.cache.42 = tx_news_domain_model_news:27,sys_category:26 ``` -------------------------------- ### Integrate Publish Date with Cache Expiration for All Pages Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/BestPractice/ClearCache/Index.rst This TypoScript setup applies cache expiration based on the publish date for all pages where the News plugin is used. Ensure the storage folder UID is correctly specified. ```typoscript config.cache.all = tx_news_domain_model_news:27 ``` -------------------------------- ### Configure CSS File Path Source: https://github.com/georgringer/news/blob/main/Documentation/Reference/TypoScript/GeneralSettings.rst Set the path to the CSS file that will be included with the layouts. This is a string value. ```typoscript plugin.tx_news.settings.cssFile = EXT:my_sitepackage/Resources/Public/Css/News.css ``` -------------------------------- ### Limit Categories to Specific Roots (TYPO3 11.4+) Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/BestPractice/TsConfigExamples/Index.rst Starting with TYPO3 11.4, use `treeConfig.startingPoints` to limit the available categories to specific root UIDs. This is useful for organizing categories across different page trees. ```typoscript TCEFORM.tx_news_domain_model_news.categories.config.treeConfig.startingPoints = 8,42 ``` -------------------------------- ### Followup Documentation Source: https://github.com/georgringer/news/blob/main/Documentation/Misc/Changelog/6-1-0.rst This entry refers to a followup in the documentation. ```gitcommit 2017-08-08 [DOC] Followup (Commit 60d3449 by Georg Ringer) ``` -------------------------------- ### RenderMediaViewHelper Source: https://github.com/georgringer/news/blob/main/Documentation/Reference/ViewHelpers/RenderMediaViewHelper.rst ViewHelper to render media from any content. It allows customization of how images, videos, and audio are displayed. ```APIDOC ## RenderMediaViewHelper ### Description ViewHelper to render media from any content. It allows customization of how images, videos, and audio are displayed. ### Method Not Applicable (This is a ViewHelper, not a direct API endpoint) ### Endpoint Not Applicable ### Parameters #### General Properties - **news** (Tx_News_Domain_Model_News) - Required - The news post for which to render media. - **imgClass** (string) - Optional - Add css class to images. - **videoClass** (string) - Optional - Wrap videos in a div with this css class. - **audioClass** (string) - Optional - Wrap audio files in a div with this css class. - **fileIndex** (integer) - Optional - Index of image to start with. Defaults to 0. - **cropVariant** (string) - Optional - Select a cropping variant. Defaults to "default". ### Request Example ```html
    {newsItem.bodytext}
    ``` ### Response #### Success Response (200) Media tags in RTE of the text are replaced with images, videos, or audio players according to the provided content and configuration. #### Response Example (Output depends on the media content and configuration. Example: HTML rendering of media elements.) ``` -------------------------------- ### Show related news by tags Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/BestPractice/IntegrationWithTypoScript/Index.rst This TypoScript configuration displays news items that share tags with the current news item. It requires the VHS extension for Fluid iterator view helpers. Adapt 'detailPid' and 'startingPoint' to your setup. ```typoscript lib.tx_news.relatedByTags = USER lib.tx_news.relatedByTags { userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run extensionName = News pluginName = NewsListSticky vendorName = GeorgRinger mvc { callDefaultActionIfActionCantBeResolved = 1 } settings < plugin.tx_news.settings settings { # custom tag to use in List.html relatedView = 1 # limit number of news limit = 6 # startingpoint = 1 useStdWrap := addToList(tags) tags.current = 1 categoryConjunction = or overrideFlexformSettingsIfEmpty := addToList(detailPid) excludeAlreadyDisplayedNews = 1 } } ``` ```html {newsItem.tags->v:iterator.extract(key:'uid')->v:iterator.implode(glue: ',')} ``` -------------------------------- ### Automatic iCalendar Feed Generation TypoScript Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/BestPractice/ICalendar/Index.rst This TypoScript configuration automatically generates iCalendar feeds for multiple list views without additional setup. It clears specific wrappers and selects news content elements for the feed. ```typoscript [getTSFE() && getTSFE().type == 9819] lib.stdheader > tt_content.stdWrap.innerWrap > tt_content.stdWrap.wrap > # get away
    if your logged into the backend styles.content.get.stdWrap > pageNewsICalendar = PAGE pageNewsICalendar.typeNum = 9819 pageNewsICalendar.10 < styles.content.get pageNewsICalendar.10.select.where = colPos=0 AND CType = "news_pi1" pageNewsICalendar.10.select { orderBy = sorting ASC max = 1 } config { # deactivate Standard-Header disableAllHeaderCode = 1 # no xhtml tags xhtml_cleaning = none admPanel = 0 metaCharset = utf-8 # you need an english locale to get correct rfc values for , ... locale_all = en_EN # define charset additionalHeaders = Content-Type:text/calendar;charset=utf-8 disablePrefixComment = 1 linkVars > } # set the format ``` -------------------------------- ### Basic ViewHelper Structure Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/Templates/ViewHelpers/Index.rst This is the fundamental structure for calling any ViewHelper in a Fluid template. Replace 'f' with the appropriate namespace and 'fo' with the ViewHelper name. ```html bar ``` -------------------------------- ### Configure templateLayout Source: https://github.com/georgringer/news/blob/main/Documentation/Reference/TypoScript/PluginSettings.rst Selects a specific template layout. ```TypoScript plugin.tx_news.settings.templateLayout = 123 ``` -------------------------------- ### Generate RSS Feed with Plain TypoScript Source: https://github.com/georgringer/news/blob/main/Documentation/Tutorials/BestPractice/Rss/Index.rst A basic TypoScript setup to create an RSS feed. It defines a PAGE object, configures headers for XML output, and includes news plugin settings for categories, limit, and detail page. ```typoscript pageNewsRSS = PAGE pageNewsRSS { # Override the typeNum if you have more than one feed typeNum = {$plugin.tx_news.rss.channel.typeNum} config { disableAllHeaderCode = 1 xhtml_cleaning = none admPanel = 0 debug = 0 disablePrefixComment = 1 metaCharset = utf-8 additionalHeaders.10.header = Content-Type:application/rss+xml;charset=utf-8 absRefPrefix = {$plugin.tx_news.rss.channel.link} linkVars > } 10 < tt_content.news_pi1.20 10 { settings < plugin.tx_news.settings settings { categories = 9 categoryConjunction = notor limit = 30 detailPid = 25 startingpoint = 24 format = xml # Override the typeNum if you have more than one feed, must be the same as above! #list.rss.channel.typeNum = {$plugin.tx_news.rss.channel.typeNum} } } } ``` -------------------------------- ### Define columns in administration module Source: https://github.com/georgringer/news/blob/main/Documentation/Reference/TsConfig/Administration.rst Specify the list of columns to display in the administration module. ```typoscript tx_news.module.columns = datetime,archive,author ```