diff --git a/config/sites/ep-reisen/config.yaml b/config/sites/ep-reisen/config.yaml index 91285d0b..8444105a 100644 --- a/config/sites/ep-reisen/config.yaml +++ b/config/sites/ep-reisen/config.yaml @@ -239,3 +239,4 @@ routeEnhancers: '.ical': 1710 'sitemap.xml': 1533906435 'yoast-snippetpreview.json': 1480321830 + '/pxa': 7378121 diff --git a/public/typo3conf/ext/ep_theme/Configuration/TypoScript/Extensions/PxaSocialFeed.typoscript b/public/typo3conf/ext/ep_theme/Configuration/TypoScript/Extensions/PxaSocialFeed.typoscript index 64043e3a..0edc942e 100644 --- a/public/typo3conf/ext/ep_theme/Configuration/TypoScript/Extensions/PxaSocialFeed.typoscript +++ b/public/typo3conf/ext/ep_theme/Configuration/TypoScript/Extensions/PxaSocialFeed.typoscript @@ -6,6 +6,7 @@ plugin.tx_pxasocialfeed { templateRootPaths.100 = EXT:ep_theme/Resources/Private/Templates/SocialMedia/ partialRootPaths.100 = EXT:ep_theme/Resources/Private/Partials/SocialMedia/ } + settings.defaultAjaxUid = {$plugin.tx_eptheme.settings.defaultAjaxUid} } page.includeCSS { diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/_app.js b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/_app.js index addd73e5..9e6fe920 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/_app.js +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/_app.js @@ -5,7 +5,8 @@ import Vue from 'vue' import $ from 'jquery' import dayjs from 'dayjs' import 'dayjs/locale/de' -import fancybox from '@fancyapps/fancybox' +import '@fancyapps/fancybox' +import axios from 'axios' global.$ = global.jQuery = $; @@ -144,39 +145,9 @@ new Vue({ }, initCarousels () { let $carouselItemWrappers = $('.slider--teasers > .slider__items').not('.slick-initialized'); + let initCallback = this.initTeaserSlider; $.each($carouselItemWrappers, function () { - let maxNumberOfSlides = $(this).parent('.slider').hasClass('in-column') ? 3 : 4; - $(this).slick({ - accessibility: false, // This is a hack to avoid a slick carousel bug. see: https://github.com/kenwheeler/slick/issues/1407#issuecomment-325228683 - mobileFirst: true, - infinite: false, - slidesToShow: 1.25, - slidesToScroll: 1, - arrows: false, - responsive: [ - { - breakpoint: 1200, - settings: { - slidesToShow: maxNumberOfSlides, - arrows: true, - prevArrow: sliderPrevArrow, - nextArrow: sliderNextArrow - } - }, - { - breakpoint: 992, - settings: { - slidesToShow: maxNumberOfSlides - 0.5, - } - }, - { - breakpoint: 768, - settings: { - slidesToShow: 2.25, - } - } - ] - }); + initCallback($(this)); }); $carouselItemWrappers = $('.slider--thirds > .slider__items').not('.slick-initialized'); $.each($carouselItemWrappers, function () { @@ -215,6 +186,40 @@ new Vue({ }); }); }, + initTeaserSlider ($element) { + let maxNumberOfSlides = $element.parent('.slider').hasClass('in-column') ? 3 : 4; + $element.slick({ + accessibility: false, // This is a hack to avoid a slick carousel bug. see: https://github.com/kenwheeler/slick/issues/1407#issuecomment-325228683 + mobileFirst: true, + infinite: false, + slidesToShow: 1.25, + slidesToScroll: 1, + arrows: false, + responsive: [ + { + breakpoint: 1200, + settings: { + slidesToShow: maxNumberOfSlides, + arrows: true, + prevArrow: sliderPrevArrow, + nextArrow: sliderNextArrow + } + }, + { + breakpoint: 992, + settings: { + slidesToShow: maxNumberOfSlides - 0.5, + } + }, + { + breakpoint: 768, + settings: { + slidesToShow: 2.25, + } + } + ] + }); + }, initContentsliders () { $('.slider--content > .slider__items, .slider--product > .slider__items').not('.slick-initialized').slick({ dots: true, @@ -352,6 +357,21 @@ new Vue({ url += separator + 'agenturcode=' + paCode; $(this).attr('href', url); }); + }, + loadSocialFeed () { + const $feedWrapper = $('[data-social-feed]'); + if ($feedWrapper.length) { + const uri = $feedWrapper.data('uri'); + axios.get(uri) + .then(response => { + $feedWrapper.html(response.data.html); + const $slider = $feedWrapper.find('.slider__items'); + this.initTeaserSlider($slider); + }) + .catch(error => { + $feedWrapper.html('
Social feed konnte nicht geladen werden.
') + }) + } } }, created () { @@ -389,6 +409,7 @@ new Vue({ this.initPartnerIdSelect(); this.initFaqFilter(); this.appendPaCode(); + this.loadSocialFeed(); }); } }); diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/SocialMedia/Frontend/FeedsItems.html b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/SocialMedia/Frontend/FeedsItems.html new file mode 100644 index 00000000..7331e7ca --- /dev/null +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/SocialMedia/Frontend/FeedsItems.html @@ -0,0 +1,38 @@ + + +