Commit 9ef69ece authored by Thomas Löffler's avatar Thomas Löffler

Merge branch 'preparev9' into 'master'

Preparation for v9

See merge request !5
parents 192b990d 8b03ad26
Pipeline #1021 passed with stage
in 2 minutes and 28 seconds
......@@ -16,43 +16,32 @@ $frontendPrefix = 'LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf
$languageFilePrefix = 'LLL:EXT:just_news/Resources/Private/Language/locallang_be.xlf:';
$newsDoktype = 12;
$fields = [
'news_datetime' => [
'exclude' => 0,
'label' => $languageFilePrefix . 'pages.news_datetime',
'config' => [
'type' => 'input',
'size' => 13,
'eval' => 'datetime,required',
'default' => 0,
],
],
];
// Copy palette configuration from "title" to new "title_for_news"
$GLOBALS['TCA']['pages']['palettes']['title_news'] = $GLOBALS['TCA']['pages']['palettes']['title'];
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns(
'pages',
$fields
// Copy palette configuration from "editorial" to new "editorial_for_news"
// Remove lastUpdate from palette
$GLOBALS['TCA']['pages']['palettes']['editorial_news'] = \TYPO3\CMS\Core\Utility\GeneralUtility::rmFromList(
'lastUpdated;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.lastUpdated_formlabel',
$GLOBALS['TCA']['pages']['palettes']['editorial']
);
// Copy palette configuration from "title" to new "title_for_news"
$GLOBALS['TCA']['pages']['palettes']['title_for_news'] = $GLOBALS['TCA']['pages']['palettes']['title'];
// Add news_datetime to title_for_news palette
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addFieldsToPalette(
'pages',
'title_for_news',
'news_datetime',
'title_news',
'lastUpdated;LLL:EXT:just_news/Resources/Private/Language/locallang_be.xlf:pages.lastUpdated',
'after:title'
);
// Copy behaviour from standard page to news page
$GLOBALS['TCA']['pages']['types'][$newsDoktype]['showitem'] =
'--palette--;' . $frontendPrefix . 'pages.palettes.standard;standard,
--palette--;' . $frontendPrefix . 'pages.palettes.title;title_for_news,
--palette--;' . $frontendPrefix . 'pages.palettes.title;title_news,
categories,
--palette--;' . $frontendPrefix . 'pages.palettes.abstract;abstract,
--palette--;' . $frontendPrefix . 'pages.palettes.metatags;metatags,
--palette--;' . $frontendPrefix . 'pages.palettes.editorial;editorial,
--palette--;' . $frontendPrefix . 'pages.palettes.editorial;editorial_news,
--div--;' . $frontendPrefix . 'pages.tabs.resources,
--palette--;' . $frontendPrefix . 'pages.palettes.media;media,
--div--;' . $frontendPrefix . 'pages.tabs.appearance,
......@@ -104,4 +93,4 @@ call_user_func(
$newsDoktype,
'pages',
$languageFilePrefix
);
\ No newline at end of file
);
......@@ -20,19 +20,18 @@ $languageFilePrefix = 'LLL:EXT:just_news/Resources/Private/Language/locallang_be
'CType',
[
$languageFilePrefix . 'CType.news_list',
'news_list',
'overlay-list'
'NewsList',
'apps-pagetree-justnews'
],
'uploads',
'after'
);
$GLOBALS['TCA']['tt_content']['types']['news_list'] = [
$GLOBALS['TCA']['tt_content']['types']['NewsList'] = [
'showitem' => '
--palette--;' . $frontendLanguageFilePrefix . 'palette.general;general,
--palette--;' . $frontendLanguageFilePrefix . 'palette.header;header,
pages;' . $languageFilePrefix . 'CType.news_list.records,recursive,
pi_flexform;LLL:EXT:just_news/Resources/Private/Language/locallang_be.xlf:CType.NewsList.flexform_pi,
--div--;' . $frontendLanguageFilePrefix . 'tabs.appearance,
--palette--;' . $frontendLanguageFilePrefix . 'palette.frames;frames,
--div--;' . $frontendLanguageFilePrefix . 'tabs.access,
......@@ -40,4 +39,15 @@ $GLOBALS['TCA']['tt_content']['types']['news_list'] = [
--palette--;' . $frontendLanguageFilePrefix . 'palette.access;access,
--div--;' . $frontendLanguageFilePrefix . 'tabs.extended,rowDescription,
--div--;LLL:EXT:lang/locallang_tca.xlf:sys_category.tabs.category,categories'
];
\ No newline at end of file
];
$GLOBALS['TCA']['tt_content']['ctrl']['typeicon_classes']['NewsList'] = 'apps-pagetree-justnews';
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['NewsList'] = 'recursive,select_key,pages';
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['NewsList'] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue(
'',
'FILE:EXT:just_news/Configuration/FlexForm/NewsList.xml',
'NewsList'
);
mod {
wizards.newContentElement.wizardItems.special {
elements {
news_list {
icon-identifier = content-special-menu
NewsList {
iconIdentifier = apps-pagetree-justnews
title = LLL:EXT:just_news/Resources/Private/Language/locallang_be.xlf:wizard.title
description = LLL:EXT:just_news/Resources/Private/Language/locallang_be.xlf:wizard.description
tt_content_defValues {
CType = news_list
CType = NewsList
}
}
}
show := addToList(news_list)
show := addToList(NewsList)
}
}
\ No newline at end of file
}
tt_content {
news_list =< lib.fluidContent
news_list {
NewsList =< lib.contentElement
NewsList {
templateName = NewsList
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
10 {
table = pages
pidInList.field = pages
recursive.field = recursive
pidInList.data = flexform:pi_flexform:settings.startingpoint
recursive.data = flexform:pi_flexform:settings.recursive
selectFields = pages.*
max = {$plugin.tx_justnews.maxItems}
max.data = flexform:pi_flexform:settings.maxItems
where = NOT hidden AND doktype = 12
languageField = sys_language_uid
orderBy = news_datetime DESC
orderBy = lastUpdated DESC
as = news
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
......@@ -42,17 +42,3 @@ tt_content {
}
}
}
[globalVar = GP:L>0]
tt_content {
news_list {
dataProcessing {
10 {
selectFields = pages.*, pages_language_overlay.title
leftjoin = pages_language_overlay ON pages_language_overlay.pid = pages.uid
where = NOT pages.hidden AND pages.doktype = 12 AND NOT pages_language_overlay.hidden
}
}
}
}
[global]
lib.fluidContent {
lib.contentElement {
templateRootPaths {
30 = EXT:just_news/Resources/Private/Templates
12 = EXT:just_news/Resources/Private/Templates
}
partialRootPaths {
30 = EXT:just_news/Resources/Private/Partials
12 = EXT:just_news/Resources/Private/Partials
}
layoutRootPaths {
30 = EXT:just_news/Resources/Private/Layouts
12 = EXT:just_news/Resources/Private/Layouts
}
}
<INCLUDE_TYPOSCRIPT: source="DIR:EXT:just_news/Configuration/TypoScript/RenderingDefinitions" extensions="ts">
<INCLUDE_TYPOSCRIPT: source="DIR:EXT:just_news/Configuration/TypoScript/RenderingDefinitions" extensions="typoscript">
......@@ -6,14 +6,14 @@
<trans-unit id="news_page_type" xml:space="preserve">
<source>News page</source>
</trans-unit>
<trans-unit id="pages.news_datetime" xml:space="preserve">
<trans-unit id="pages.lastUpdated" xml:space="preserve">
<source>News datetime</source>
</trans-unit>
<trans-unit id="CType.news_list" xml:space="preserve">
<source>News listing</source>
</trans-unit>
<trans-unit id="CType.news_list.records" xml:space="preserve">
<source>Pages with news sub elements</source>
<trans-unit id="CType.NewsList.flexform_pi" xml:space="preserve">
<source>News Options</source>
</trans-unit>
<trans-unit id="wizard.title" xml:space="preserve">
<source>News listing (just_news)</source>
......@@ -24,6 +24,12 @@
<trans-unit id="constants.maxItems" xml:space="preserve">
<source>Maximum items in list (zero = all)</source>
</trans-unit>
<trans-unit id="flexform.recursive.inherit" xml:space="preserve">
<source>Defined in TypoScript</source>
</trans-unit>
<trans-unit id="flexform.maxItems" xml:space="preserve">
<source>Maximum items to display (0 = all)</source>
</trans-unit>
</body>
</file>
</xliff>
\ No newline at end of file
</xliff>
......@@ -15,14 +15,14 @@
</f:if>
<h3>
<f:link.page pageUid="{newsItem.data.uid}">
{newsItem.data.title} ({newsItem.data.news_datetime -> f:format.date(format:'{settings.list.dateFormat}')})
{newsItem.data.title} ({newsItem.data.lastUpdated -> f:format.date(format:'{settings.list.dateFormat}')})
</f:link.page>
</h3>
<p>
<small><f:render partial="NewsMeta" arguments="{_all}" /></small><br>
{newsItem.data.abstract -> f:format.nl2br()}<br>
<f:link.page pageUid="{newsItem.data.uid}">
<f:translate key="read_more" />
<f:translate key="LLL:EXT:just_news/Resources/Private/Language/locallang.xlf:read_more" />
</f:link.page>
</p>
</div>
......
<html xmlns:f="http://xsd.helhum.io/ns/typo3/cms-fluid/master/ViewHelpers">
<div id="c{data.uid}">
<!--TYPO3SEARCH_end-->
<f:render partial="Header" arguments="{_all}" />
<f:render partial="Header/All" arguments="{_all}" />
<f:if condition="{news -> f:count()} > 0">
<ol>
<f:for each="{news}" as="newsItem">
......
{
"name": "spooner-web/just_news",
"type": "typo3-cms-extension",
"description": "Easy and lightweight news extension.",
"homepage": "https://typo3.org",
"license": [
"GPL-2.0+"
],
"description": "Easy, flexible and lightweight news extension. No extra tables needed, using pages for news articles.",
"homepage": "https://git.spooner.io/spooner/just_news",
"license": "GPL-2.0+",
"support": {
"issues": "https://git.spooner.io/spooner/just_news/issues",
"source": "https://git.spooner.io/spooner/just_news"
},
"keywords": [
"TYPO3",
"extension",
......@@ -22,7 +24,7 @@
}
],
"require": {
"typo3/cms-core": "^7.6 || ^8.7",
"typo3/cms-core": "^9.4",
"typo3/cms-fluid-styled-content": "*"
},
"config": {
......@@ -32,7 +34,8 @@
"extra": {
"typo3/cms": {
"cms-package-dir": "{$vendor-dir}/typo3/cms",
"web-dir": ".Build/Web"
"web-dir": ".Build/Web",
"extension-key": "just_news"
}
}
}
......@@ -14,15 +14,15 @@
$EM_CONF[$_EXTKEY] = [
'title' => 'Just News - easy like bicycling',
'description' => 'A news system used with core features. Easy to use, easy to extend.',
'description' => 'Easy, flexible and lightweight news extension. No extra tables needed, using pages for news articles.',
'category' => 'fe',
'version' => '0.1.1',
'version' => '1.0.0',
'state' => 'stable',
'author' => 'Thomas Löffler',
'constraints' => [
'depends' => [
'typo3' => '7.6.0-7.6.99',
'fluid_styled_content' => '7.6.0'
'typo3' => '9.4.0-9.4.99',
'fluid_styled_content' => ''
],
'conflicts' => [],
'suggests' => []
......
......@@ -47,7 +47,7 @@ $boot = function ($packageKey) {
// Adds page TypoScript for the news list content element
TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(
'<INCLUDE_TYPOSCRIPT: source="FILE:EXT:just_news/Configuration/TypoScript/PageTS/news_list.ts">'
'<INCLUDE_TYPOSCRIPT: source="FILE:EXT:just_news/Configuration/TypoScript/PageTS/NewsList" extensions="typoscript">'
);
};
......
CREATE TABLE pages (
news_datetime int(11) DEFAULT '0' NOT NULL
);
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment