Skip to content
Snippets Groups Projects
Commit 848a110e authored by Matthias Adrowski's avatar Matthias Adrowski
Browse files

Merge remote-tracking branch 'origin/master' into feature_Upgrade-to-TYPO3-11

parents 0634cc5f 9a1876ef
No related branches found
No related tags found
1 merge request!38Feature upgrade to typo3 11
......@@ -129,6 +129,9 @@ class ListByCategoryController extends AbstractController {
if (isset($this->settings['tags'])) {
$tagUids = GeneralUtility::intExplode(',', $this->settings['tags'], TRUE);
}
HeaderMetaDataService::addPageNumberToCanonical($currentPageBrowserPage);
foreach ($categoryUids as $categoryUid) {
if ($categoryUid > 0) {
$filterByCategories = TRUE;
......
......@@ -34,6 +34,7 @@ use SGalinski\SgNews\Domain\Repository\TagRepository;
use SGalinski\SgNews\Domain\Service\NewsService;
use SGalinski\SgNews\Service\ConfigurationService;
use SGalinski\SgNews\Service\HeaderMetaDataService;
use SGalinski\SgSeo\Service\HeadTagService;
use TYPO3\CMS\Core\Http\ImmediateResponseException;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
......@@ -147,6 +148,8 @@ class OverviewController extends AbstractController {
$isCategoryFiltered = $useAllFilters || (int) $this->settings['groupBy'] === 1;
$isTagFiltered = $useAllFilters || (int) $this->settings['groupBy'] === 2;
HeaderMetaDataService::addPageNumberToCanonical($currentPageBrowserPage);
// Get tag pid
$tagPid = (int) $this->settings['tagPid'];
if (!$tagPid) {
......@@ -434,6 +437,8 @@ class OverviewController extends AbstractController {
$newsPerPage = (int) $this->settings['newsLimit'];
$offset = $this->calculatePaginationOffset($currentPageBrowserPage, $newsPerPage);
HeaderMetaDataService::addPageNumberToCanonical($currentPageBrowserPage);
$newsCount = 0;
$categoryIds = NULL;
$categoriesById = [];
......
......@@ -26,7 +26,11 @@ namespace SGalinski\SgNews\Service;
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use SGalinski\SgSeo\Service\HeadTagService;
use TYPO3\CMS\Core\Package\Exception;
use TYPO3\CMS\Core\Resource\FileReference;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
/**
......@@ -56,4 +60,31 @@ class HeaderMetaDataService {
$typoScriptController = $GLOBALS['TSFE'];
$typoScriptController->page['og_image_path_by_extension'] = $file;
}
/**
* Adds the page number to the canonical
*
* @param int $currentPage
* @return void
* @throws Exception
*/
public static function addPageNumberToCanonical(int $currentPage): void {
if ($currentPage < 1) {
return;
}
if (version_compare(ExtensionManagementUtility::getExtensionVersion('sg_seo'), '5.0.0', '>=')) {
$headTagService = GeneralUtility::makeInstance(
HeadTagService::class,
FALSE,
'',
'',
'&tx_sgnews_pagebrowser[currentPage]=' . $currentPage
);
$headTagService->execute();
} else {
$GLOBALS['TSFE']->page['extensionArgumentsForCanonicalAndHrefLang'] =
'&tx_sgnews_pagebrowser[currentPage]=' . $currentPage;
}
}
}
......@@ -107,6 +107,16 @@
</config>
</TCEforms>
</settings.sortBy>
<settings.newsLink>
<TCEforms>
<label>LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:plugin.flexForm.newsLink</label>
<config>
<type>input</type>
<renderType>inputLink</renderType>
</config>
</TCEforms>
</settings.newsLink>
</el>
</ROOT>
</main>
......
......@@ -3,7 +3,13 @@ routeEnhancers:
type: Plugin
namespace: tx_sgnews_pagebrowser
routePath: '/{localizedSegment}/{currentPage}'
defaults:
currentPage: '0'
aspects:
currentPage:
type: StaticRangeMapper
start: '1'
end: '1000'
localizedSegment:
type: LocaleModifier
default: page
......
......@@ -307,6 +307,30 @@ pagebrowser.settings {
}
```
Example route enhancers with a static range for the page number to be able to generate URLs without additional cHash parameter
```YAML
routeEnhancers:
PageBrowserNews:
type: Plugin
namespace: tx_sgnews_pagebrowser
routePath: '/{localizedSegment}/{currentPage}'
defaults:
currentPage: '0'
aspects:
currentPage:
type: StaticRangeMapper
start: '1'
end: '1000'
localizedSegment:
type: LocaleModifier
default: page
localeMap:
-
locale: 'de_DE.*'
value: page
```
---
###### addLike
......
......@@ -165,6 +165,10 @@
<source><![CDATA[News Author]]></source>
<target><![CDATA[News Autor]]></target>
</trans-unit>
<trans-unit id="plugin.flexForm.newsLink" approved="yes">
<source><![CDATA[Link]]></source>
<target><![CDATA[Link]]></target>
</trans-unit>
<trans-unit id="plugin.flexForm.orderInPageTree" approved="yes">
<source><![CDATA[Order in pagetree (Only one category allowed)]]></source>
<target><![CDATA[Reihenfolge im Seitenbaum (Nur eine Kategorie erlaubt)]]></target>
......
......@@ -126,6 +126,9 @@
<trans-unit id="plugin.flexForm.newsAuthor">
<source><![CDATA[News Author]]></source>
</trans-unit>
<trans-unit id="plugin.flexForm.newsLink">
<source><![CDATA[Link]]></source>
</trans-unit>
<trans-unit id="plugin.flexForm.orderInPageTree">
<source><![CDATA[Order in pagetree (Only one category allowed)]]></source>
</trans-unit>
......
......@@ -36,33 +36,33 @@ $sg-news-chevron-color: var(--component-color-primary-background, $black-base);
display: none;
position: relative;
bottom: -10px;
width: auto !important; // stylelint-disable-line
width: auto !important; // stylelint-disable-line
@media (min-width: $screen-sm) {
display: block;
}
}
&[data-current-columns="3"] {
&[data-current-columns='3'] {
.sg-slide-dots__indicator {
&:not(:nth-child(3n+1)) {
&:not(:nth-child(3n + 1)) {
display: none;
}
}
.sg-slide:not(:nth-child(3n+1)) {
.sg-slide:not(:nth-child(3n + 1)) {
border-left: 1px solid $sg-news-border-color;
}
}
&[data-current-columns="2"] {
&[data-current-columns='2'] {
.sg-slide-dots__indicator {
&:not(:nth-child(2n+1)) {
&:not(:nth-child(2n + 1)) {
display: none;
}
}
.sg-slide:not(:nth-child(2n+1)) {
.sg-slide:not(:nth-child(2n + 1)) {
border-left: 1px solid $sg-news-border-color;
}
}
......@@ -76,7 +76,7 @@ $sg-news-chevron-color: var(--component-color-primary-background, $black-base);
.sg-slide-news-content {
margin-bottom: 16px;
padding: 0 50px
padding: 0 50px;
}
.tx-sgnews-teaser-description {
......@@ -90,7 +90,7 @@ $sg-news-chevron-color: var(--component-color-primary-background, $black-base);
display: block;
content: '';
width: $sg-news-headline-underline-width;
height: #{$sg-news-headline-underline-width / 6};
height: calc(#{$sg-news-headline-underline-width} / 6);
background: $sg-news-foreground-color;
}
}
......
......@@ -6,7 +6,7 @@
"license": [
"GPL-2.0-or-later"
],
"version": "9.8.3",
"version": "9.8.6",
"support": {
},
"repositories": [
......
......@@ -19,7 +19,7 @@ $EM_CONF['sg_news'] = [
'modify_tables' => '',
'clearCacheOnLoad' => 0,
'lockType' => '',
'version' => '9.8.3',
'version' => '9.8.6',
'constraints' => [
'depends' => [
'typo3' => '10.4.0-11.5.99',
......
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