Implement plugin for booking link page rendering

This commit is contained in:
Björn Fromme
2019-09-13 17:58:55 +02:00
parent 07e712b46e
commit bcda84924e
8 changed files with 217 additions and 145 deletions
+18
View File
@@ -120,6 +120,24 @@ routeEnhancers:
type: PersistedAliasMapper type: PersistedAliasMapper
tableName: tx_epproducts_domain_model_hotel tableName: tx_epproducts_domain_model_hotel
routeFieldName: uid routeFieldName: uid
BookingLinkPlugin:
type: Extbase
extension: EpProducts
plugin: booking_link
limitToPages:
- 1787
routes:
-
routePath: '/{product}'
_controller: 'Product::detail'
_arguments:
product: product
defaultController: 'Product::detail'
aspects:
product:
type: PersistedAliasMapper
tableName: tx_epproducts_domain_model_product
routeFieldName: path_segment
SearchResultPlugin: SearchResultPlugin:
type: Extbase type: Extbase
extension: EpProducts extension: EpProducts
@@ -29,6 +29,12 @@ call_user_func(function () {
'Produktdetails' 'Produktdetails'
); );
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
'EP.EpProducts',
'booking_link',
'Buchungslink'
);
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
'EP.EpProducts', 'EP.EpProducts',
'product_teasergroup', 'product_teasergroup',
@@ -28,7 +28,7 @@ return [
concept_description, board_description, additional_services, programme_description, ski_pass_description, concept_description, board_description, additional_services, programme_description, ski_pass_description,
rating_average, rating_votes_count, teaser_images, header_images, images, concept, country, region, city, rating_average, rating_votes_count, teaser_images, header_images, images, concept, country, region, city,
journey, facts, officetip, hotels, calendar_hotel, faqs,header_title,header_subtitle, alt_product, alt_label, journey, facts, officetip, hotels, calendar_hotel, faqs,header_title,header_subtitle, alt_product, alt_label,
video, banner, additional_regions, badge, daytrip, testimonials, external_link', video, banner, additional_regions, badge, daytrip, testimonials, external_link, path_segment',
], ],
'types' => [ 'types' => [
'1' => [ '1' => [
@@ -45,7 +45,7 @@ return [
'palettes' => [ 'palettes' => [
'destinations' => ['showitem' => 'country,region,city'], 'destinations' => ['showitem' => 'country,region,city'],
'top' => ['showitem' => 'searchable, bookable, daytrip, important, skipass_included, detail_page, 'top' => ['showitem' => 'searchable, bookable, daytrip, important, skipass_included, detail_page,
external_link'], external_link, path_segment'],
'name' => ['showitem' => 'name,code'], 'name' => ['showitem' => 'name,code'],
'alternative' => ['showitem' => 'alt_product, alt_label'], 'alternative' => ['showitem' => 'alt_product, alt_label'],
'header' => ['showitem' => 'headline,subline,--linebreak--,header_title,header_subtitle'], 'header' => ['showitem' => 'headline,subline,--linebreak--,header_title,header_subtitle'],
@@ -806,6 +806,22 @@ return [
'type' => 'input', 'type' => 'input',
'eval' => 'trim', 'eval' => 'trim',
] ]
] ],
'path_segment' => [
'exclude' => 0,
'label' => 'Buchungslink URL',
'config' => [
'type' => 'slug',
'generatorOptions' => [
'fields' => ['name'],
'prefixParentPageSlug' => false,
'replacements' => [
'/' => '-',
],
],
'fallbackCharacter' => '-',
'eval' => 'uniqueInSite',
],
],
], ],
]; ];
@@ -80,6 +80,17 @@ $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\EP\EpProducts\T
] ]
); );
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'EP.' . $_EXTKEY,
'booking_link',
[
'Product' => 'detail,hotelList',
],
[
'Product' => '',
]
);
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'EP.' . $_EXTKEY, 'EP.' . $_EXTKEY,
'product_teasergroup', 'product_teasergroup',
@@ -22,6 +22,7 @@ CREATE TABLE tx_epproducts_domain_model_product
bus_pro_id int(11) unsigned NOT NULL default '0', bus_pro_id int(11) unsigned NOT NULL default '0',
detail_page varchar(255) DEFAULT '' NOT NULL, detail_page varchar(255) DEFAULT '' NOT NULL,
external_link varchar(255) DEFAULT '' NOT NULL, external_link varchar(255) DEFAULT '' NOT NULL,
path_segment varchar(255) DEFAULT '' NOT NULL,
description text NOT NULL, description text NOT NULL,
teaser text NOT NULL, teaser text NOT NULL,
teaser_long text NOT NULL, teaser_long text NOT NULL,
@@ -63,6 +63,9 @@ class ContextProcessor implements DataProcessorInterface
if ($regionUid > 0) { if ($regionUid > 0) {
$processedData['context']['region'] = $this->getContextRecord($regionUid, 'tx_epproducts_domain_model_region'); $processedData['context']['region'] = $this->getContextRecord($regionUid, 'tx_epproducts_domain_model_region');
} }
if ($data['tx_eptheme_context_pacode']) {
$processedData['context']['paCode'] = $data['tx_eptheme_context_pacode'];
} else {
$resellerData = $this->getResellerData(); $resellerData = $this->getResellerData();
if ($resellerData) { if ($resellerData) {
$processedData['context']['paCode'] = $resellerData['paCode']; $processedData['context']['paCode'] = $resellerData['paCode'];
@@ -71,6 +74,7 @@ class ContextProcessor implements DataProcessorInterface
} elseif ($cookieData = CookieUtility::getPaCookie()) { } elseif ($cookieData = CookieUtility::getPaCookie()) {
$processedData['context']['paCode'] = $cookieData; $processedData['context']['paCode'] = $cookieData;
} }
}
return $processedData; return $processedData;
} }
@@ -5,6 +5,15 @@ defined('TYPO3_MODE') or die();
call_user_func(function() { call_user_func(function() {
$temporaryColumns = [ $temporaryColumns = [
'tx_eptheme_context_pacode' => [
'exclude' => 0,
'label' => 'PA Code für diese Seite',
'config' => [
'type' => 'input',
'size' => 8,
'eval' => 'trim',
],
],
'tx_eptheme_context_country_code' => [ 'tx_eptheme_context_country_code' => [
'config' => [ 'config' => [
'type' => 'passthrough' 'type' => 'passthrough'
@@ -101,7 +110,7 @@ call_user_func(function() {
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes( \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes(
'pages', 'pages',
'--div--;Kontext, '--div--;Kontext,
tx_eptheme_context_country,tx_eptheme_context_region, tx_eptheme_context_pacode,tx_eptheme_context_country,tx_eptheme_context_region,
tx_eptheme_hide_searchbar,tx_eptheme_bodyclass, tx_eptheme_hide_searchbar,tx_eptheme_bodyclass,
--div--;Slider, --div--;Slider,
tx_eptheme_slides, tx_eptheme_slides,
+18 -11
View File
@@ -2,7 +2,8 @@
# #
# Table structure for table 'tx_eptheme_domain_model_slider' # Table structure for table 'tx_eptheme_domain_model_slider'
# #
CREATE TABLE tx_eptheme_domain_model_slide ( CREATE TABLE tx_eptheme_domain_model_slide
(
uid int(11) NOT NULL auto_increment, uid int(11) NOT NULL auto_increment,
pid int(11) DEFAULT '0' NOT NULL, pid int(11) DEFAULT '0' NOT NULL,
@@ -39,15 +40,16 @@ CREATE TABLE tx_eptheme_domain_model_slide (
PRIMARY KEY (uid), PRIMARY KEY (uid),
KEY parent (pid), KEY parent (pid),
KEY t3ver_oid (t3ver_oid,t3ver_wsid), KEY t3ver_oid (t3ver_oid, t3ver_wsid),
KEY language (l10n_parent,sys_language_uid) KEY language (l10n_parent, sys_language_uid)
); );
# #
# Table structure for table 'tx_eptheme_domain_model_lineup' # Table structure for table 'tx_eptheme_domain_model_lineup'
# #
CREATE TABLE tx_eptheme_domain_model_lineup ( CREATE TABLE tx_eptheme_domain_model_lineup
(
uid int(11) NOT NULL auto_increment, uid int(11) NOT NULL auto_increment,
pid int(11) DEFAULT '0' NOT NULL, pid int(11) DEFAULT '0' NOT NULL,
@@ -86,12 +88,14 @@ CREATE TABLE tx_eptheme_domain_model_lineup (
PRIMARY KEY (uid), PRIMARY KEY (uid),
KEY parent (pid), KEY parent (pid),
KEY t3ver_oid (t3ver_oid,t3ver_wsid), KEY t3ver_oid (t3ver_oid, t3ver_wsid),
KEY language (l10n_parent,sys_language_uid) KEY language (l10n_parent, sys_language_uid)
); );
CREATE TABLE pages ( CREATE TABLE pages
(
tx_eptheme_context_pacode char(8) DEFAULT '',
tx_eptheme_context_country_code char(2) DEFAULT '', tx_eptheme_context_country_code char(2) DEFAULT '',
tx_eptheme_context_country int(11) unsigned DEFAULT '0', tx_eptheme_context_country int(11) unsigned DEFAULT '0',
tx_eptheme_context_region int(11) unsigned DEFAULT '0', tx_eptheme_context_region int(11) unsigned DEFAULT '0',
@@ -103,7 +107,8 @@ CREATE TABLE pages (
tx_eptheme_badge int(11) unsigned DEFAULT '0' tx_eptheme_badge int(11) unsigned DEFAULT '0'
); );
CREATE TABLE pages_language_overlay ( CREATE TABLE pages_language_overlay
(
tx_eptheme_context_country_code char(2) DEFAULT '', tx_eptheme_context_country_code char(2) DEFAULT '',
tx_eptheme_context_country int(11) unsigned DEFAULT '0', tx_eptheme_context_country int(11) unsigned DEFAULT '0',
tx_eptheme_context_region int(11) unsigned DEFAULT '0', tx_eptheme_context_region int(11) unsigned DEFAULT '0',
@@ -115,7 +120,8 @@ CREATE TABLE pages_language_overlay (
tx_eptheme_badge int(11) unsigned DEFAULT '0' tx_eptheme_badge int(11) unsigned DEFAULT '0'
); );
CREATE TABLE tt_content ( CREATE TABLE tt_content
(
tx_eptheme_context_country int(11) unsigned DEFAULT '0', tx_eptheme_context_country int(11) unsigned DEFAULT '0',
tx_eptheme_context_region int(11) unsigned DEFAULT '0', tx_eptheme_context_region int(11) unsigned DEFAULT '0',
tx_eptheme_context_city int(11) unsigned DEFAULT '0', tx_eptheme_context_city int(11) unsigned DEFAULT '0',
@@ -129,7 +135,8 @@ CREATE TABLE tt_content (
button varchar(255) DEFAULT '' NOT NULL button varchar(255) DEFAULT '' NOT NULL
); );
CREATE TABLE tx_eptheme_domain_model_addresscheck ( CREATE TABLE tx_eptheme_domain_model_addresscheck
(
uid int(11) NOT NULL auto_increment, uid int(11) NOT NULL auto_increment,
pid int(11) DEFAULT '0' NOT NULL, pid int(11) DEFAULT '0' NOT NULL,
tstamp int(11) DEFAULT '0' NOT NULL, tstamp int(11) DEFAULT '0' NOT NULL,
@@ -166,5 +173,5 @@ CREATE TABLE tx_eptheme_domain_model_addresscheck (
PRIMARY KEY (uid), PRIMARY KEY (uid),
KEY parent (pid), KEY parent (pid),
KEY pid (pid,email) KEY pid (pid, email)
); );