Skip to content

Instantly share code, notes, and snippets.

View alexander-schranz's full-sized avatar

Alexander Schranz alexander-schranz

View GitHub Profile
@alexander-schranz
alexander-schranz / sulu-windows-xampp-install.md
Last active April 22, 2016 11:01
Install Sulu on Windows with Xampp
alias gs='git status'
alias ga='git add'
alias gc='git commit'
alias gco='git checkout'
alias gac='git commit -a'
alias gp='git push'
alias gpo='git push origin'
alias gl='git pull'
alias glo='git pull origin'
alias gm='git merge --no-ff'
@alexander-schranz
alexander-schranz / SuluExtendController.php
Last active December 29, 2021 15:19
Custom sulu controller which load some data from a service
<?php
namespace App\Controller\Website;
use Sulu\Bundle\WebsiteBundle\Controller\WebsiteController;
use Sulu\Component\Content\Compat\StructureInterface;
/**
* Controller which needs a custom service to add data to render twig template.
*/
@alexander-schranz
alexander-schranz / AbstractSuluWebsiteController.php
Last active July 26, 2018 15:29
Render twig template with sulu parameters and set a default cache lifetime
<?php
namespace AppBundle\Controller\Website;
use Sulu\Bundle\HttpCacheBundle\Cache\HttpCache;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;
abstract class AbstractWebsiteController extends Controller
{
@alexander-schranz
alexander-schranz / SassMeister-input.scss
Created February 17, 2016 21:44
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
$black: #000000;
$white: #ffffff;
$blue: #032459;
$grey: #cfcfcf;
$darkGrey: #9B9B9B;
@alexander-schranz
alexander-schranz / SassMeister-input-HTML.html
Created February 18, 2016 08:10
Generated by SassMeister.com.
<button>
Button
</button>
<button class="blue">
Button Blue
</button>
<button class="white background-blue">
Button
@alexander-schranz
alexander-schranz / twig-pagination.html.twig
Last active September 18, 2016 13:21
A twig include for rendering a pagination
{#- A twig html pagination with correct handling of many pages.
#
# arrows bool
# page int
# maxPage int
# limit int
-#}
{% if maxPage > 1 %}
<div class="pagination">
@alexander-schranz
alexander-schranz / main.js
Last active April 12, 2018 13:36
Load custom css in sulu
// src/AppBundle/Resources/public/js/main.js
require.config({
paths: {
app: '../../app/js',
appcss: '../../app/css'
}
});
define(['css!appcss/main'], function() {
@alexander-schranz
alexander-schranz / FormController.php
Last active May 15, 2020 05:53
Sulu controller to add a form to your template
<?php
// namespace AppBundle\Controller\Website; This is for 1.6
namespace App\Controller\Website\FormController;
use Sulu\Bundle\WebsiteBundle\Controller\WebsiteController;
use Sulu\Component\Content\Compat\StructureInterface;
use Symfony\Component\HttpFoundation\Request;
class FormController extends WebsiteController
@alexander-schranz
alexander-schranz / AppAdmin.php
Last active April 7, 2020 17:30
AppAdmin mit custom js and css for Sulu 1.6
<?php
namespace AppBundle\Admin;
use Sulu\Bundle\AdminBundle\Admin\Admin;
use Sulu\Bundle\AdminBundle\Navigation\Navigation;
use Sulu\Bundle\AdminBundle\Navigation\NavigationItem;
use Sulu\Component\Security\Authorization\SecurityCheckerInterface;
/**