Skip to content

Instantly share code, notes, and snippets.

View sbonardt's full-sized avatar

Sebastiaan Bonardt sbonardt

  • Sebbon / Flink
  • Den Haag
View GitHub Profile
@sbonardt
sbonardt / .zshrc
Created January 17, 2019 12:26
Oh my zsh .zshrc
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="mh"
# Uncomment the following line to use case-sensitive completion.
@sbonardt
sbonardt / drupal-field-collection-templating
Last active June 1, 2016 07:49
Drupal: theming a field in a field collection
<?php
/*
* Template naming convention:
*
* field colelction field -> field_collection_field_name
* field example -> field_name
*
* field-collection-item--field-collection-field-name.tpl.php
* field--field__name--field_collection_field_name.tpl.php
*
{# for Bolt.cm
Situation: A chapter contains an undefined amount of items, either with typefield "A" or with typefield "B"
(two "levels"). Print these items out in a hierarchical menu with nested ul's (2 levels deep as per "A" and "B"
If you need more levels, add -for instance- "C" and add extra checks in the code
Goal:
Go through the list of items in any chapter and print out hierarchical nested UL's based on these
two "levels": the types A and B.
#}
{#
Name: bolt-taxonomy-navigation.twig
Description: Defining taxonomy categories and using them as navigation in Bolt. Only print out those with records assigned to them
Author: S. Bonardt
CMS: Bolt CMS - Bolt.cm
Define the categories like below in taxonomy.yml, using key and value (under 'options') i.s.o. default way. E.G:
categories:
name: Categories