Skip to content

Instantly share code, notes, and snippets.

@alrnz
alrnz / TextlinkViewHelper.php
Created April 26, 2016 14:21
TextlinkViewHelper
<?php
namespace Sunzinet\SzNewsroom\ViewHelpers;
/**
* This file is part of the TYPO3 CMS project.
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
@alrnz
alrnz / .htaccess
Last active August 10, 2016 15:42
Redirect http to https without checking HTTPS != on
# ----------------------------------------------------------------------
# | Forcing `https://` |
# ----------------------------------------------------------------------
# Redirect from the `http://` to the `https://` version of the URL.
# On my Server the %{HTTPS} !=on does not work and always redirects
# (infinite redirect loop with the "Too many redirects"-error)
<IfModule mod_rewrite.c>
RewriteEngine On
@alrnz
alrnz / .htaccess
Created September 21, 2016 16:16 — forked from brichards/.htaccess
Tell Apache to serve missing images from a remote server. Props http://stackoverflow.com/questions/5130410/modrewrite-to-another-server-if-file-image-is-not-found
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteRule ^(.*\.(js|css|png|jpe?g|gif|ico)) http://example.com/$1 [NC,L]
</IfModule>
$(window).scroll(function() {
var height = $(window).scrollTop();
if(height > some_number) {
// do something
}
});
@alrnz
alrnz / parse.php
Created December 7, 2016 11:03
TYPO3 RTE (and link) parser in PHP
<?php
// parse all rte tags
$output = $this->pi_RTEcssText($text);
// parse only br and a tags
$output = strip_tags($this->pi_RTEcssText($text, '<br><a>');
// parse only links (link-Tag in the RTE)
$this->htmlParser = t3lib_div::makeInstance("t3lib_parsehtml_proc");
@alrnz
alrnz / tt_content.ts
Created January 9, 2017 12:02
TYPO3 TypoScript HTML in Bildunterschriften erlauben TYPO3 TypoScript allow HTML in image caption
tt_content.image.20.caption.1.1.htmlSpecialChars = 0
@alrnz
alrnz / auto_core_update_email.php
Last active January 12, 2017 09:53 — forked from annalinneajohansson/auto_core_update_email.php
Change the recipient email for auto_core_update_email
<?php
// change email of auto update notification
function filter_change_auto_update_email( $email ) {
$email['to'] = 'username@example.com';
return $email;
}
add_filter( 'auto_core_update_email', 'filter_change_auto_update_email', 1 );
@alrnz
alrnz / replace.ts
Last active January 24, 2017 13:10
Replace a | in a string with a username. This is just an example to show how complex replacements in TypoScript works. Please don't insert a username on every page like this. It kills caching.
stdWrap.replacement {
10 {
search = |
replace.stdWrap.cObject = COA
replace.stdWrap.cObject {
10 = TEXT
10.data = TSFE:fe_user|user|first_name
10.noTrimWrap = || |
20 = TEXT
20.data = TSFE:fe_user|user|last_name
@alrnz
alrnz / newsDetail.html
Created March 11, 2017 13:08
TYPO3 News - use Heise shariff for sharing in News Extension
{namespace n=GeorgRinger\News\ViewHelpers}
{namespace v=FluidTYPO3\Vhs\ViewHelpers}
<v:variable.set name="newsurl" value="{n:link(newsItem:'{newsItem}', settings:'{settings}', uriOnly:1, configuration:'{forceAbsoluteUrl: 1}')}" />
<!-- shariff ext -->
<div class="social-wrap">
<html xmlns:rx="http://typo3.org/ns/Reelworx/RxShariff/ViewHelper">
<rx:shariff data="{url: '{newsurl}'}" services="facebook,whatsapp,twitter,googleplus,mail" enableBackend="false" />
</html>
@alrnz
alrnz / seo_basics.ts
Last active July 17, 2019 09:22
Set static domain for SEO-Basics TYPO3 Extension
// add to the USER object (tx_seo_xmlsitemaps.10 = USER)
tx_seo_xmlsitemaps.10.useDomain = https://www.site.de/