Skip to content

Instantly share code, notes, and snippets.

@ogrosko
ogrosko / gist:03e725f32a5429fbf826d7a67c8fb198
Last active June 1, 2016 14:21
TYPO3 DB datetime format
$GLOBALS['TYPO3_DB']->getDateTimeFormats('table_name');
@ogrosko
ogrosko / ProductionExceptionHandler.php
Created June 1, 2016 14:24
Typo3 Plugin exception custom handling
<?php
namespace BinaryBay\BbBoilerplate\ContentObject\Exception;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\HttpUtility;
use TYPO3\CMS\Extbase\Utility\DebuggerUtility;
use TYPO3\CMS\Frontend\ContentObject\AbstractContentObject;
class ProductionExceptionHandler extends \TYPO3\CMS\Frontend\ContentObject\Exception\ProductionExceptionHandler {
@ogrosko
ogrosko / PageBansViewHelper.php
Created June 1, 2016 14:27
Typo3 checkbox group handling
<?php
namespace BinaryBay\BbBoilerplate\ViewHelpers;
class PageBansViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper {
/**
* @var array
*/
const PAGE_BAN_FIELD = 'page_ban';
@ogrosko
ogrosko / Libs.ts
Created September 22, 2016 10:23
Typo3 RTE table class
lib.parseFunc_RTE {
externalBlocks {
table {
stdWrap {
wrap = <div class="table-responsive">|</div>
HTMLparser.tags.table.fixAttrib.class.list:= addToList(table-bordered)
}
}
}
}
@ogrosko
ogrosko / gist:ac528907299c439515856e4068359c69
Created September 22, 2016 14:19
Typo3 fluid pidInRootline
<v:condition.iterator.contains needle="<the page id>" haystack="{v:page.rootline() -> v:iterator.extract(key: 'uid')}">
is in
</v:condition.iterator.contains>
@ogrosko
ogrosko / gist:244ef10074555682688cf38804c3e948
Created September 30, 2016 13:31
Typo3 FAL fields extend
//can be found in b2b.austria project
@ogrosko
ogrosko / template.html
Created December 6, 2016 13:51
Typo3 BE modal, confirm
<button
class="btn btn-danger"
onclick="return top.TYPO3.Modal.confirm('Are you sure', 'Are you sure you want ot delete all records', top.TYPO3.Severity.warning)
.on('confirm.button.ok', function() {
window.location.href = '<f:uri.action action='deleteAllRdo' />';
top.TYPO3.Modal.currentModal.trigger('modal-dismiss');
})
.on('confirm.button.cancel', function() {
top.TYPO3.Modal.currentModal.trigger('modal-dismiss');
});"
@ogrosko
ogrosko / post-merge
Last active December 8, 2016 09:20
Git post-merge hook
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
# Global use: https://coderwall.com/p/jp7d5q/create-a-global-git-commit-hook
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
@ogrosko
ogrosko / dce.html
Created December 21, 2016 09:32
Dce gridelement depend
<f:switch expression="gridelement{contentObject.parentgrid_tx_gridelements_backend_layout}_col{contentObject.tx_gridelements_columns}">
<f:case value="gridelement4_col1">
<v:variable.set name="imageWidth" value="524c" />
<v:variable.set name="imageHeight" value="524c" />
<v:variable.set name="imageCol" value="6" />
<v:variable.set name="textCol" value="6" />
</f:case>
<f:case value="gridelement4_col2">
<v:variable.set name="imageWidth" value="524c" />
<v:variable.set name="imageHeight" value="524c" />
@ogrosko
ogrosko / Setup.ts
Created November 16, 2017 13:50
bodyTagCObject class with template name
bodyTagCObject = COA
bodyTagCObject {
10 = TEXT
10 {
data = page:uid
stdWrap.noTrimWrap = |page-uid-| |
}
20 = TEXT
20 {