Skip to content

Instantly share code, notes, and snippets.

View joekolade's full-sized avatar

Joe Kolade joekolade

View GitHub Profile
@joekolade
joekolade / constants.ts
Created July 9, 2015 15:07
TYPO3 Responsive Imagehandling
styles.content.imgtext.captionSplit = 1
@joekolade
joekolade / Email_recommend.ts
Last active March 1, 2023 21:19
[E-Mail recommend this site] A simple recommendation link in Typoscript #typo3 #typoscript
10 = TEXT
10.wrap = <a href="mailto:?Subject={$text.emailTip}&body={$text.emailTipBody} | ">
10.data = getIndpEnv:TYPO3_REQUEST_URL
@joekolade
joekolade / LangSwitch.ts
Last active March 3, 2023 11:03
[Langswitch] Typoscript Langswicth based on HMENU w/ fallback #typo3 #typoscript
lib.langSwitch = HMENU
lib.langSwitch {
special = language
special.value = 0,1
special.normalWhenNoLanguage = 0
1 = TMENU
1 {
noBlur = 1
# Standard Sprachen
NO = 1
@joekolade
joekolade / Neos console commands
Last active March 3, 2023 11:04
[Neos Console Commands] commonly used commands for Neos CMS #neos #shell
# Flush or warmup caches
./flow flow:cache:warmup
./flow flow:cache:flush
# Flush or warmup caches in other contexts
FLOW_CONTEXT=Production ./flow flow:cache:flush
# Kickstart Page
./flow kickstart:site
@joekolade
joekolade / AbtractPage.fusion
Last active March 3, 2023 11:04 — forked from abteilung/Favicons.fusion
[Favicons in Neos CMS] Render Favicons with Neos CMS #neos #fusion
prototype(Joekolade.SbfwSite:Document.AbstractPage) < prototype(Neos.Neos:Page) {
head {
favicons = Joekolade.SbfwSite:Component.Favicon
headTags = Neos.Fusion:Component {
renderer = afx`
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
`
}
@joekolade
joekolade / bootstrap_extbase_plugin_TSsetup.ts
Last active March 3, 2023 11:05
[Run Extbase Plugin] Typoscript: Bootstrap Extbase Plugin #typo3 #typoscript
temp.include = USER
temp.include {
userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
vendorName = Events
pluginName = Eventlist
extensionName = Events
settings =< plugin.tx_events.settings
persistence =< plugin.tx_events.persistence
view =< plugin.tx_events.view
@joekolade
joekolade / gist:6fbf847ed4b634868385
Last active March 3, 2023 11:06
[Install clean npm on mac] #mac #shell
ls -1 /usr/local/node_modules > ~/node_modules.txt
rm -rf /usr/local/lib/node_modules
brew uninstall node
brew install node --without-npm
echo prefix=~/.node >> ~/.npmrc
curl -L https://www.npmjs.org/install.sh | sh
export PATH="$HOME/.node/bin:$PATH"
for i in cat ~/node_modules.txt;do npm install -g $i;done
@joekolade
joekolade / snippet.php
Last active March 3, 2023 11:08
[Debug per IP] PHP Debug information based on request IP #typo3
if($_SERVER['REMOTE_ADDR'] == '37.209.17.41'){
var_dump($var);
exit;
}
@joekolade
joekolade / ModelController.php
Last active March 3, 2023 11:09 — forked from oliverthiele/ModelController.php
[Extbase Error Handling] ErrorAction handling Errors in Extbase Actions #typo3
/**
* A special action which is called if the originally intended action could
* not be called, for example if the arguments were not valid.
*
* The default implementation sets a flash message, request errors and forwards back
* to the originating action. This is suitable for most actions dealing with form input.
*
* We clear the page cache by default on an error as well, as we need to make sure the
* data is re-evaluated when the user changes something.
*
@joekolade
joekolade / DropzoneModifier.php
Last active March 3, 2023 11:09
[TYPO3 FE Edit] Enable frontend_editing with gridelements in TYPO3 CMS 8.7 #typo3 #typoscript
<?php
declare(strict_types=1);
namespace Vendor\Extension\Hooks;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\FrontendEditing\EditingPanel\FrontendEditingDropzoneModifier;
use TYPO3\CMS\FrontendEditing\Service\ContentEditableWrapperService;
/**