Skip to content

Instantly share code, notes, and snippets.

@s2b
s2b / config.js
Created October 9, 2013 12:59
Require.js plugin to detect the global jQuery version and use a local jQuery if the global version is too old.
// Map jquery module to the plugin
// Credits to jburke
// https://github.com/jrburke/requirejs/issues/451#issuecomment-8442745
require.config({
map: {
'*': {
'jquery': 'jquery!'
}
}
});
@s2b
s2b / gist:6b2df1dfbb398e8203ce
Created August 13, 2014 12:45
TYPO3/ExtBase: Get upload path from TCA
<?php
class SomeClass{
protected function getUploadPath($table, $field) {
global $TCA;
$cObj = $this->configurationManager->getContentObject();
t3lib_div::loadTCA($table);
@s2b
s2b / MyRepository.php
Last active August 29, 2015 14:06
TYPO3/ExtBase: Repository helper functions for custom queries http://somethingphp.com/custom-queries-in-extbase/
<?php
class MyRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {
/**
* Returns an enableFields SQL statement for the specified table
* @param string $tableName name of the database table
* @return string enableFields SQL statement
*/
protected function enableFields($tableName) {
if (TYPO3_MODE === 'FE') {
@s2b
s2b / PageTS.ts2
Last active November 7, 2019 10:52
Responsive Images and TYPO3: http://somethingphp.com/responsive-images-typo3/
TCEFORM.tt_content {
# Disable fields that specify/change image dimensions
imagewidth.disabled = 1
imageheight.disabled = 1
section_frame.disabled = 1
# Limit column selection
imagecols.keepItems = 1, 2, 3, 4
imagecols.types.textpic.keepItems = 1, 2
}

Keybase proof

I hereby claim:

  • I am s2b on github.
  • I am s2b (https://keybase.io/s2b) on keybase.
  • I have a public key whose fingerprint is 2073 A8AC AB3F 45C2 4CEA 6DC6 9D7E 2929 9DF3 DC6D

To claim this, I am signing this object:

@s2b
s2b / StandaloneViewUtility.php
Last active August 12, 2016 15:50
Class that implements templateRootPaths as well as substitution of “EXT:” in partial/layout rootPaths to Fluid StandaloneView in TYPO3 < 7.3
<?php
namespace VENDOR\MyExtension\Utility;
use TYPO3\CMS\Fluid\View\StandaloneView;
use TYPO3\CMS\Extbase\Utility\ArrayUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
class StandaloneViewUtility
{
@s2b
s2b / 01_ComponentsInFluid.md
Last active May 9, 2018 10:01
Components in Fluid

Components in Fluid

Folder structure

  • Resources/Private/Components
    • UserProfile
      • Assets
        • avatar-max.jpg
        • avatar-erika.jpg
  • UserProfile.css
@s2b
s2b / deploy.yaml
Last active November 24, 2022 10:03
TYPO3 Deployment with Deployer7
import:
- recipe/common.php
- contrib/rsync.php
- contrib/cachetool.php
config:
shared_files:
- .env
shared_dirs:
- var