Skip to content
Snippets Groups Projects
Commit d67f49e1 authored by Kevin Ditscheid's avatar Kevin Ditscheid
Browse files

[FEATURE] Add a new location field

parent 5da76f9d
No related branches found
No related tags found
No related merge requests found
......@@ -86,6 +86,11 @@ class News extends CategoryAndNews {
*/
protected $likes;
/**
* @var string
*/
protected $location;
/**
* Constructor
*/
......@@ -290,4 +295,19 @@ class News extends CategoryAndNews {
public function setLikes($likes) {
$this->likes = $likes;
}
/**
* @return string
*/
public function getLocation() {
return $this->location;
}
/**
* @param string $location
*/
public function setLocation($location) {
$this->location = $location;
}
}
......@@ -205,11 +205,32 @@ $columns = array_merge(
'default' => $GLOBALS['EXEC_TIME'],
]
],
'tx_sgnews_location' => [
'exclude' => TRUE,
'label' => 'LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tx_sgnews_location',
'config' => [
'type' => 'input',
'size' => 20,
'eval' => 'trim'
]
]
], $imageColumns
);
$languageOverlayColumns = array_merge(
[
'tx_sgnews_location' => [
'exclude' => TRUE,
'label' => 'LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tx_sgnews_location',
'config' => [
'type' => 'input',
'size' => 20,
'eval' => 'trim'
]
]
], $imageColumns
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('pages', $columns);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('pages_language_overlay', $imageColumns);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('pages_language_overlay', $languageOverlayColumns);
$GLOBALS['TCA']['pages']['palettes']['titleDescriptionAndHighlightFlag'] = [
'showitem' => 'subtitle;LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.subtitle.inPalette,
......@@ -225,7 +246,7 @@ if (\SGalinski\SgNews\Utility\VersionUtility::isVersion870OrHigher()) {
'showitem' => 'tx_sgnews_author;LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tx_sgnews_author.inPalette,
author;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.author_formlabel,
--linebreak--, lastUpdated;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.lastUpdated_formlabel,
tx_sgnews_likes',
tx_sgnews_likes,--linebreak--,tx_sgnews_location',
'canNotCollapse' => 1,
];
......@@ -282,7 +303,7 @@ if (\SGalinski\SgNews\Utility\VersionUtility::isVersion870OrHigher()) {
$GLOBALS['TCA']['pages_language_overlay']['types'][116] = [
'showitem' => '--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.standard;standard,
subtitle;LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.subtitle.inPalette,
description, tx_realurl_pathsegment, author,
description, tx_realurl_pathsegment, author, tx_sgnews_location,
--div--;LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tabs.images,
tx_sgnews_teaser2_image, tx_sgnews_teaser1_image,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.metadata,
......@@ -314,7 +335,7 @@ if (\SGalinski\SgNews\Utility\VersionUtility::isVersion870OrHigher()) {
'showitem' => 'tx_sgnews_author;LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tx_sgnews_author.inPalette,
author;LLL:EXT:cms/locallang_tca.xlf:pages.author_formlabel,
--linebreak--, lastUpdated;LLL:EXT:cms/locallang_tca.xlf:pages.lastUpdated_formlabel,
tx_sgnews_likes',
tx_sgnews_likes,--linebreak--,tx_sgnews_location',
'canNotCollapse' => 1,
];
......@@ -371,7 +392,7 @@ if (\SGalinski\SgNews\Utility\VersionUtility::isVersion870OrHigher()) {
$GLOBALS['TCA']['pages_language_overlay']['types'][116] = [
'showitem' => '--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.standard;standard,
subtitle;LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.subtitle.inPalette,
description, tx_realurl_pathsegment, author,
description, tx_realurl_pathsegment, author, tx_sgnews_location,
--div--;LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tabs.images,
tx_sgnews_teaser2_image, tx_sgnews_teaser1_image,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.metadata,
......
......@@ -16,6 +16,7 @@ config.tx_extbase {
tx_sgnews_teaser2_image.mapOnProperty = teaser2Image
tx_sgnews_tags.mapOnProperty = tags
tx_sgnews_likes.mapOnProperty = likes
tx_sgnews_location.mapOnProperty = location
}
}
}
......
......@@ -57,6 +57,10 @@
<source>Use Image Cropping</source>
<target>Bild-Cropping aktivieren</target>
</trans-unit>
<trans-unit id="pages.tx_sgnews_location">
<source>Location</source>
<target>Ort</target>
</trans-unit>
<trans-unit id="plugin.flexForm" approved="yes">
<source>Settings</source>
<target>Einstellungen</target>
......
......@@ -45,6 +45,9 @@
<trans-unit id="pages.tx_sgnews_use_image_crop">
<source>Use Image Cropping</source>
</trans-unit>
<trans-unit id="pages.tx_sgnews_location">
<source>Location</source>
</trans-unit>
<trans-unit id="plugin.flexForm">
<source>Settings</source>
</trans-unit>
......
......@@ -49,6 +49,12 @@
</f:if>
</span>
<f:if condition="{newsMetaData.news.location}">
<span class="location">
{newsMetaData.news.location}
</span>
</f:if>
<span class="date">
<f:format.date format="%d. %B %Y">{newsMetaData.news.lastUpdated}</f:format.date>
</span>
......
......@@ -7,11 +7,13 @@ CREATE TABLE pages (
tx_sgnews_teaser2_image int(11) unsigned DEFAULT '0' NOT NULL,
tx_sgnews_tags int(11) unsigned DEFAULT '0' NOT NULL,
tx_sgnews_likes int(11) unsigned DEFAULT '0' NOT NULL,
tx_sgnews_location mediumtext,
KEY author (tx_sgnews_author)
);
CREATE TABLE pages_language_overlay (
tx_sgnews_teaser1_image int(11) unsigned DEFAULT '0' NOT NULL,
tx_sgnews_teaser2_image int(11) unsigned DEFAULT '0' NOT NULL
tx_sgnews_teaser2_image int(11) unsigned DEFAULT '0' NOT NULL,
tx_sgnews_location mediumtext
);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment