Skip to content

Instantly share code, notes, and snippets.

@georgringer
georgringer / CategoryViewHelper.php
Last active Nov 3, 2021
Get categories of a table
View CategoryViewHelper.php
<?php
declare(strict_types=1);
namespace GeorgRinger\SitePackage\ViewHelpers;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Resource\FileRepository;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
@georgringer
georgringer / news-sharing.html
Created May 27, 2021
Share news article without any extra ext
View news-sharing.html
<nav class="newsdetail__sharing-sidebar" role="navigation" aria-label="sharing">
<f:variable name="currentUrl">{n:link(newsItem:newsItem,uriOnly:1,configuration:{forceAbsoluteUrl:1}) -> f:format.htmlentities()}</f:variable>
<a target="_blank" rel="noopener" title="Auf Facebook teilen" href="https://www.facebook.com/sharer/sharer.php?u={currentUrl}" class="newsdetail__sharing-sidebar__link"><span class="fab fa-facebook">&nbsp;</span></a>
<a target="_blank" rel="noopener" title="Auf twitter teilen" href="https://twitter.com/share?url={currentUrl}" class="newsdetail__sharing-sidebar__link"><span class="fab fa-twitter">&nbsp;</span></a>
<a target="_blank" rel="noopener" title="Auf pinterest teilen" href=
"https://pinterest.com/pin/create/button/?url={currentUrl}" class="newsdetail__sharing-sidebar__link"><span class="fab fa-pinterest">&nbsp;</span></a>
<a target="_blank" rel="noopener" title="via email teilen" href=
"mailto:?subject=XYZ%20empfiehlt%20{newsItem.title}" class="ne
@georgringer
georgringer / EmailValidator.php
Last active Dec 14, 2020
Powermail check if value is same in other fields, like for email double validation
View EmailValidator.php
<?php
namespace VENDOR\EXT\Domain\Powermail;
use In2code\Powermail\Domain\Model\Mail;
use In2code\Powermail\Domain\Validator\AbstractValidator;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Error\Result;
class EmailValidator extends AbstractValidator
View XclassedRedirectService.php
<?php
declare(strict_types = 1);
namespace Vendor\Theme\Xclass;
use Psr\Http\Message\UriInterface;
use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerAwareTrait;
use TYPO3\CMS\Core\Http\Uri;
use TYPO3\CMS\Core\LinkHandling\LinkService;
@georgringer
georgringer / HrefLangGenerator.php
Created Sep 17, 2019
Allow fallbacks for hreflang in TYPO3 9
View HrefLangGenerator.php
<?php
declare(strict_types=1);
namespace JosefGlatz\Theme\Xclass;
use JosefGlatz\Theme\Service\LanguageAvailability;
use TYPO3\CMS\Core\Site\Entity\Site;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor;
use TYPO3\CMS\Seo\HrefLang\HrefLangGenerator;
@georgringer
georgringer / HrefLangNews.php
Last active Nov 13, 2019
Get relevant langage ids for menus, e.g. hreflang or language switch
View HrefLangNews.php
<?php
namespace GeorgRinger\News\Hooks;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* Get language ids for news language menu
*
@georgringer
georgringer / setup.typoscript
Last active Sep 18, 2019
Google Tag Manager with CMS 9. The Site module is extended to allow site admins to edit the GTM code
View setup.typoscript
page {
headerData.50 = TEXT
headerData.50 {
if.isTrue.data = site:googleTagManager
stdWrap.replacement {
10 {
search = ###CODE###
replace.data = site:googleTagManager
}
View SortAlphabeticalViewHelper.php
<?php
namespace GeorgRinger\News\ViewHelpers\Format;
use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
/**
* This file is part of the "news" Extension for TYPO3 CMS.
*
* For the full copyright and license information, please read the
@georgringer
georgringer / ConfigurationReader.php
Last active Nov 23, 2018
XCLASS of EXT:realurl to avoid issues with FB parameter fbclid
View ConfigurationReader.php
<?php declare(strict_types=1);
// in your sitepackage Classes/Xclass/Realurl/ConfigurationReader.php
namespace Vendor\SitePackage\Xclass\Realurl;
class ConfigurationReader extends \DmitryDulepov\Realurl\Configuration\ConfigurationReader {
protected $defaultValues = array(
'cache/banUrlsRegExp' => '/tx_solr|tx_indexedsearch|tx_kesearch|(?:^|\?|&)q=/',
@georgringer
georgringer / sysext_dependencies.md
Created Jul 25, 2018
Dependenies (or suggestions) from one sysext to another one
View sysext_dependencies.md

about

  • Backend
  • Core

adminpanel