Skip to content

Instantly share code, notes, and snippets.

View htuscher's full-sized avatar

Hans Tuscher htuscher

  • Everybody needs a Hans
  • Regensburg, Germany
  • 10:43 (UTC +02:00)
View GitHub Profile
@htuscher
htuscher / gist:c4b41068975b4bb84816
Created March 9, 2015 12:50
TYPO3 Solr index sys_file_reference uid from related record
listImageUid_intS = CONTENT
listImageUid_intS {
table = sys_file_reference
select {
selectFields = sys_file_reference.uid
max = 1
where = 1=1
pidInList = 1
recursive = 10
andWhere = sys_file_reference.tablenames = "myTable" AND sys_file_reference.fieldname = "myField" AND sys_file_reference.uid_foreign = {field:uid}
@htuscher
htuscher / PageView.php
Created April 26, 2015 12:52
TYPO3 Neos track PageViews
<?php
namespace Jhoechtl\MySite\Domain\Model;
/* *
* This script belongs to the TYPO3 Flow package "Jhoechtl.MySite". *
* *
* */
use TYPO3\Flow\Annotations as Flow;
use Doctrine\ORM\Mapping as ORM;
@htuscher
htuscher / NodeHelper.php
Last active December 19, 2015 04:34
Neos Sliding ContentCollection
<?php
/***************************************************************
* Copyright notice
*
* (c) 2015 Hans Höchtl <[email protected]>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@htuscher
htuscher / AjaxForm.html
Created May 14, 2015 20:53
TYPO3 Neos Ajax Form
<!-- This is the HTML that is loaded by the TS AjaxForm object -->
<div{attributes -> f:format.raw()}>
<f:if condition="{formIdentifier}">
<f:then>
<div data-ajax="ajax-loaded-form" data-identifier="{formIdentifier}" data-presetName="{presetName}">
<p>Loading form please wait</p>
</div>
</f:then>
<f:else>
<p>Please select a valid Form identifier in the inspector</p>
@htuscher
htuscher / BoostQueryModifier.php
Created May 20, 2015 11:10
Solr boost on field via entered query
<?php
/***************************************************************
* Copyright notice
*
* (c) 2015 Hans Höchtl <[email protected]>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@htuscher
htuscher / temp.ts2
Created May 26, 2015 19:07
Neos FlowQuery find node by node URI
# Inside the property 'pageWithSections' Neos stores a node URI like node://185e33e0-02a7-4fb9-26ab-8078d5c146fd
# But to select a node with FlowQuery you need an identifier like #185e33e0-02a7-4fb9-26ab-8078d5c146fd
navNode = ${q(site).find('#' + String.substr(q(node).property('pageWithSections'), 7)).get(0)}
[email protected] = ${q(node).property('pageWithSections') != NULL}
@htuscher
htuscher / Settings.yaml
Created July 13, 2015 15:57
Neos keep pageTree collapsed / closed
TYPO3:
Neos:
userInterface:
navigateComponent:
nodeTree:
loadingDepth: 1
@htuscher
htuscher / PageViewController.php
Last active August 29, 2015 14:24
Neos create node links in Flow plugin
<?php
namespace Jhoechtl\MySite\Controller;
/* *
* This script belongs to the TYPO3 Flow package "Jhoechtl.MySite". *
* *
* */
use TYPO3\Flow\Annotations as Flow;
use TYPO3\Flow\Mvc\Controller\ActionController;
<?php
namespace Vendor\Package\Servlets\MyServlet;
use ...;
/**
* @Route(name="stylecardsearch", urlPattern={"/foo/bar.do", "/foo/bar.do*"}, initParams={})
*/
@htuscher
htuscher / Cache.php
Created August 4, 2015 07:12
TYPO3 Caching Framework nutzen
<?php
namespace Vendor\MyExtension\Service;
class Caching {
const DEFAULT_CACHE_EXTENSIONKEY = 'my_cache';
/**