# TYPO3 Extension 'stratis_news'

Stratis News allows to modify ext:news TCA, and brings additionals fields. Configuration is available in Extension Manager Configuration.

## Requirements

- TYPO3 9.x
- news 7.x.x
- stratis_site (just for ListImage.html)

## Installation

1) Install via composer
2) Enable in extension manager
3) Add static in root template (must be after the ext:news)
3) Flush TYPO3 and PHP Caches

## Description

This extension overrides ext:news features and brings a lot of TCA modifications and new fields.

### Modifications
- Allows to modify foreign_table_where for categories field
- Transform tags field in select side-by-side field
- Allows to modify foreign_table_where for tag field
- Add sorting for tags records
- Transform starttime and endtime (default TYPO3 fields) in date field instead of datetime (eval parameter)
- startime field (default TYPO3 field) can be required and prefilled with current date
- Allows to define max characters for teaser field
- Allows to define more fields for ordering list view
- tx_news_domain_model_link:uri allow only external URL
- Contains all patches for ext:news from TYPO3 Starter 8.7

### New fields
- 3 more fal media : home_media, main_media and user_media (with only crop field, no description no alternative no links)
- Activity 1 and 2 fields
- Content elements aside field
- Fields for contacts: tel, fax, email, www
- Fields for informations: reservation url, schedule, price, url
- Fields for person: title, name, tel, email, www
- Fields for cities: population, inhabitans, mayor, map points (for image map), website

### New tables
- tx_news_record_mm for relation between news and any other record

### Misc and Features
- Dynamically generate the elements of select lists within a TCA or Flexform definition (applied on news plugin)
- Register "n" fluid namespace
- Register "sn" fluid namespace
- Valid iCalendar template according to RFC 5545 and RFC 7986

### [FEATURE] Domain related urls from "View" button in BE interface for news records
**Resolved problem:**
On multi-domain sites with `Dossers` on `0` level news record "View" button leads to page from first site
and not depends from specified domain for current news record.

**After feature activation:**
"View" button leads to the page from domain specified for the news record.

**How to configure this feature:**<br/>
You need to configure page TSconfig as described below:
```
TCEMAIN.preview.tx_news_domain_model_news.overridePreviewPageIdForDomain.[DOMAIN_ID] = [TARGET_PAGE]
TCEMAIN.preview.tx_news_domain_model_news.overridePreviewPageIdForDomain.[SUBDOMAIN_ID] = [TARGET_PAGE_ON_SUBSITE]

// example for 107 sysfolder (actualities) from bayonne.fr

TCEMAIN.preview.tx_news_domain_model_news.overridePreviewPageIdForDomain.1 = 109
TCEMAIN.preview.tx_news_domain_model_news.overridePreviewPageIdForDomain.758 = 773
``` 

## Tests

1) Run `composer install`
2) For analyze PHP code functionality by `PHP Stan` run `composer analyze:php`
3) For fix PHP code by `PHP CodeSniffer` run `composer fix:style`
4) For analyze PHP code style by `PHP CodeSniffer` run `composer lint:style`
5) For check for errors PHP code by `PHP Parallel Lint` run `composer lint:php`
6) For check for errors XML code by `XML Lint` run `composer lint:xml`
7) For check for errors TypoScript code by `TypoScript Lint` run `composer lint:typoscript`
8) For run PHP Unit Test run `composer test:unit`
