Skip to content

Instantly share code, notes, and snippets.

View htuscher's full-sized avatar

Hans Tuscher htuscher

  • Everybody needs a Hans
  • Regensburg, Germany
  • 08:54 (UTC +02:00)
View GitHub Profile
@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;
@htuscher
htuscher / Settings.yaml
Created July 13, 2015 15:57
Neos keep pageTree collapsed / closed
TYPO3:
Neos:
userInterface:
navigateComponent:
nodeTree:
loadingDepth: 1
@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)}
navNode.@if.navNodeIsSet = ${q(node).property('pageWithSections') != NULL}
@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 <jhoechtl@gmail.com>
* 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 / NodeHelper.php
Last active December 19, 2015 04:34
Neos Sliding ContentCollection
<?php
/***************************************************************
* Copyright notice
*
* (c) 2015 Hans Höchtl <hhoechtl@1drop.de>
* 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 / 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 / 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 / Standard.html
Created February 27, 2015 13:08
FluidTYPO3 content_fallback
<div xmlns="http://www.w3.org/1999/xhtml" lang="en"
xmlns:f="http://typo3.org/ns/TYPO3/Fluid/ViewHelpers"
f:schemaLocation="https://fluidtypo3.org/schemas/fluid-master.xsd"
xmlns:flux="http://typo3.org/ns/FluidTYPO3/Flux/ViewHelpers"
flux:schemaLocation="https://fluidtypo3.org/schemas/flux-master.xsd"
xmlns:v="http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers"
v:schemaLocation="https://fluidtypo3.org/schemas/vhs-master.xsd">
<f:layout name="Page" />
<f:section name="Configuration">
@htuscher
htuscher / FluidResult.php
Created February 12, 2015 16:03
TYPO3 Solr using Fluid-Templating for results
<?php
/**
* Copyright notice
*
* (c) Onedrop Solutions GmbH & Co. KG, www.1drop.de
*
* @author Hans Höchtl <hhoechtl@1drop.de>
*
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
*/