Skip to content

Commit

Permalink
[TASK] Added sitepackage within Build directory to use for manual and…
Browse files Browse the repository at this point in the history
… automatic testing
  • Loading branch information
RinyVT committed Feb 4, 2025
1 parent 9cf3b4b commit a6b4888
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .ddev/commands/web/composer-install-sitepackage
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

valid_versions=("11" "12" "13")

if [[ ! " ${valid_versions[@]} " =~ " $1 " ]]; then
echo "Invalid version. Please use one of the following: ${valid_versions[@]}"
exit 1
fi

composer config repositories.sitepackage path ../../$EXTENSION_KEY/Build/extensions/sitepackage -d /var/www/html/v$1
composer req yoast-seo-for-typo3/sitepackage:^1.0 -n -d /var/www/html/v$1
10 changes: 10 additions & 0 deletions .ddev/commands/web/composer-remove-sitepackage
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

valid_versions=("11" "12" "13")

if [[ ! " ${valid_versions[@]} " =~ " $1 " ]]; then
echo "Invalid version. Please use one of the following: ${valid_versions[@]}"
exit 1
fi

composer remove yoast-seo-for-typo3/sitepackage -n -d /var/www/html/v$1
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

\YoastSeoForTypo3\YoastSeo\Utility\RecordUtility::configureForRecord('tx_news_domain_model_news')
->setGetParameters([
['tx_news_pi1', 'news'],
['tx_news_pi1', 'news_preview']
])
->setSitemapFields(false)
->setFieldsPosition('after:bodytext');
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import 'EXT:news/Configuration/TypoScript/constants.typoscript'
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import 'EXT:news/Configuration/TypoScript/setup.typoscript'
15 changes: 15 additions & 0 deletions Build/extensions/sitepackage/Configuration/page.tsconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
TCEMAIN.preview {
tx_news_domain_model_news {
# This previewPageId should probably be overridden within the installation
previewPageId = 6
useCacheHash = 1
useDefaultLanguageRecord = 0
fieldToParameterMap {
uid = tx_news_pi1[news_preview]
}
additionalGetParameters {
tx_news_pi1.controller = News
tx_news_pi1.action = detail
}
}
}
19 changes: 19 additions & 0 deletions Build/extensions/sitepackage/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "yoast-seo-for-typo3/sitepackage",
"type": "typo3-cms-extension",
"version": "1.0.0",
"description": "Test sitepackage for Yoast SEO for TYPO3",
"require": {
"georgringer/news": "*"
},
"extra": {
"typo3/cms": {
"extension-key": "sitepackage"
}
},
"autoload": {
"psr-4": {
"YoastSeoForTypo3\\Sitepackage\\": "Classes/"
}
}
}
20 changes: 20 additions & 0 deletions Build/extensions/sitepackage/ext_localconf.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

defined('TYPO3') || die();

ExtensionManagementUtility::addTypoScriptConstants(
"@import 'EXT:sitepackage/Configuration/TypoScript/constants.typoscript'"
);

ExtensionManagementUtility::addTypoScriptSetup(
"@import 'EXT:sitepackage/Configuration/TypoScript/setup.typoscript'"
);

if ((new Typo3Version())->getMajorVersion() < 12) {
ExtensionManagementUtility::addPageTSConfig(
"@import 'EXT:sitepackage/Configuration/page.tsconfig'"
);
}

0 comments on commit a6b4888

Please sign in to comment.