News

News Extension Package for Neos CMS

package-img
Package key Lelesys.News
Version 1.0.0-alpha1
First upload March 29, 2014
Last modified March 29, 2014
Category Frontend, Backend
Dependencies TYPO3 Neos 1.0.x
Composer: composer require lelesys/news:1.0.0-alpha1

Installation directory: Packages/Application

Author Lelesys India
Download

Documentation

News for TYPO3 Neos extension by Lelesys adds news capability for TYPO3 Neos powered website. This extension is plugin-less and fully based on nodes concept in TYPO3 Neos. You can edit news items with in place editing and extend it easily. 

You might hear from different sources that theoretically there is no need of News package for Neos being the fact that you can just create your own NodeTypes for news and writing content in it.

However it is always important to have something to get started and which works in plug and play mode. Almost for each project, News is required and with many variants of it. So efforts behind making this News package is to get started with quite common features of any News system on the websites. This package is developed keeping in mind that it has to be highly extensible and configurable.

Features in this release (1.0.0-alpha1)

  1. Fully node based
  2. Construct news article freely with all standard Neos content elements (inline editing)
  3. Multilingual ready (when TYPO3 Neos is ready for multilingual)
  4. Multiple instances (create many news folders and build views based on the selected news folders. e.g. News, Press releases, Corporate news etc.)
  5. Category tree (Categories can be created as regular document in the tree getting benefits of built-in menu rendering.)
  6. News filtering by category (WARNING: currently it is done with simple array filtering so performance will be slow with big number of news. In one of next releases integration with ElasticSearch will be added which is recommended by some of Neos core team members)
  7. News sorting by any property (WARNING: same as above)
  8. List view
  9. Latest view (almost same as List but kept separately)
  10. Single view (nothing but the news node)
  11. Meta tags
  12. Configuration:
    This package is highly configurable. Configuration can be changed at 3 levels.
    1. Settings (applies to all sites in the Neos installation)
    2. TypoScript (applies to specific site)
    3. Inspector (applies to specific view)

Available Node Types

  1. Lelesys.News:Folder (Document) - Marker document node as News Folder
  2. Lelesys.News:Category (Document) - Marker document node as News Category
  3. Lelesys.News:News (Document) - The actual news article node
  4. Lelesys.News:List (Content) - News List view
  5. Lelesys.News:Latest (Content) - News Latest view
  6. Lelesys.News:CategoryMenu - News Category Menu

Example site-map (nodes)

- Home
- - Latest News (News Latest content element, News Folder points to "News")
- - Latest Press (News Latest content element, News Folder points to "Press releases")
- About us (Page)
- Contact us (Page)
- News (News Folder)
- - TYPO3 Neos (News Category)
- -  World (News Category)
- - Web development (News Category)
- - Lelesys releases news package for TYPO3 Neos (News, hidden in menu)
- - News2 (News, hidden in menu)
- - News3 (News, hidden in menu)
- Press releases (News Folder)
- - Category1
- - Category2
- - Press release story1 (News)

Getting started

Install via composer:

1. Install Neos if not already

composer create-project typo3/neos-base-distribution /var/www/neossite 1.0.2

2. Finish Neos setup

3. Run in your project's root directory

composer require lelesys/news:1.0.0-alpha1

4. Flush and warmup cache (only for Production context)

./flow flow:cache:flush --force && ./flow flow:cache:warmup

5. Login to backend and start creating your sitemap including News as shown in above sitemap example!

Integrating in your site package


Introduction to available TypoScript prototypes and their behaviour

1. Lelesys.News:Category

By default this is automatically rendered on "News Category" document nodes to show list of matching news nodes by this category. This automatic rendering is done with additional case for TYPO3.Neos:PrimaryContent prototype. 

This internally uses the Lelesys.News:List with additional filter processing applied to filter news by current category

2. Lelesys.News:List

This is responsible for rendering news list. By default this is rendered on News Category and News Folder document nodes to show list of matching news. Also anywhere "News list" content node is added on any other page then this TypoScript prototype is used render it naturally. Lelesys.News:News prototype is used to render single news item within this list.

3. Lelesys.News:Latest

It is inherited from Lelesys.News:List with additional processing to reduce news items to specific amount like show only lastest 5 items. Lelesys.News:News is used to render single news item within this but with a different template attached to it.

4. Lelesys.News:News

Renders a single news document. It has all properties available inside the Fluid template automatically with {propertyName}. In addition to the properties {thumbnailImage} (first TYPO3.Neos:NodeTypes:Image object) and {teaserText} (first TYPO3.Neos.NodeTypes:Text) are assigned to the template.

Customisation

It is as simple as looking at the TypoScript code and override it as per your wish! So please go ahead and use whole power of TypoScript2

e.g. to change the template for List view add following TypoScript code in your site package's Root.ts2

prototype(Lelesys.News:List).templatePath = 'resource://MyVendor.MyPackage/Private/Templates/NodeTypes/List.html'

So you should have MyVendor.MyPackage/Private/Templates/NodeTypes/List.html file in your package and that's it.

Another example if you want to change the template for news item inside the List then

 prototype(Lelesys.News:List).newsItem.templatePath = 'resource://MyVendor.MyPackage/Private/Templates/NodeTypes/ListItem.html'

Configuration

If you want to change the configuration of the news views you can do it at 3 places. For instance you want to change the date format inside the List view

1. If you want it to be changed in all sites then add following code in Configuration/Settings.yaml of your package

(Make sure you set "lelesys/news" as one of require inside your package's composer.json file. This way lelesys/news is first loaded by underlying Flow package manager and then your package. So you can override the stuff correctly.)

Lelesys:
  News:
    view:
      list:
        dateFormat: 'd/m/Y'

2. If you want it to be changed in only 1 site then add following TypoScript code in Root.ts2 file inside the site package

prototype(Lelesys.News:List).configuration.dateFormat = 'd/m/Y'

please note here that prototype(Lelesys.News:List).configuration is automatically set to Lelesys.News.view.list from Settings.yaml

3. If you have added "News list" content node at several places and want date format to be changed only in specific content node then just goto Inspector for that node and add new date format in the "Date Format" inside the inspector. 
Please note: if this kind of configuration is set specific to a content node and later sometime if you change dateFormat in Settings or TypoScript then it will not be applied for this content node. It will only be applied when you set Date Format in the inspector to blank value.

Extending news

Make sure you set "lelesys/news" as one of require inside your package's composer.json file. This way lelesys/news is first loaded by underlying Flow package manager and then your package. So you can override the stuff correctly. 

If you want more properties for the News node then feel free to extend the node type Lelesys.News:News inside Configuration/NodeTypes.yaml of your package. 

Known bugs

1. Pagination is not working
2. CategoryMenu content element not working
3. Page reload is missing at some places when something is changed in the inspector

Todo list for next releases

  1. Validations (inspector)
  2. Commenting
  3. Archive menu
  4. News tags
  5. Integration with ElasticSearch or Solr to work with bigger set of news (filtering/sorting)
  6. RSS feed
  7. OpenGraph meta tags
  8. Content caching strategy (required to work with Neos 1.1 upcoming release
  9. Integration with upcoming Newsletter package from Lelesys
Categories: Neos CMS

Copyright © 2018 Lelesys Informatik GmbH, Deutschland. All Rights Reserved.