Skip to content

Instantly share code, notes, and snippets.

View mortendk's full-sized avatar
🤠
git commit -m "yolo"

mortendk mortendk

🤠
git commit -m "yolo"
View GitHub Profile
@mortendk
mortendk / menu-main.html.twig
Last active November 3, 2022 10:32
svg inside a link in drupal menus
{% import _self as menus %}
{#
We call a macro which calls itself to render the full tree.
@see http://twig.sensiolabs.org/doc/tags/macro.html
#}
{{ menus.menu_links(items, attributes, 0) }}
{% macro menu_links(items, attributes, menu_level) %}
{% import _self as menus %}
---
title: the most amazing thing
layout: base.njk
date: Last Modified # 2018-01-01
permalink: foo/bar/baz/
eleventyNavigation:
key: main
title: Home
order: 0
@mortendk
mortendk / menu--main.html.twig
Created August 5, 2015 22:21
menu with first, last & count classes in twig Drupal8 template
{#
/**
* @file
* Theme override to display a menu.
*
* Available variables:
* - menu_name: The machine name of the menu.
* - items: A nested list of menu items. Each menu item contains:
* - attributes: HTML attributes for the menu item.
* - below: The menu item child items.
@mortendk
mortendk / Contract Killer 3.md
Created May 27, 2021 08:43 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

@mortendk
mortendk / breadcrump.twig
Created October 7, 2012 17:32
twig breadcrumbs
{#
/**
* @file
* Returns HTML for a breadcrumb trail.
*
* @param $variables
* An associative array containing:
* - breadcrumb: An array containing the breadcrumb links.
*
* @ingroup themeable
@mortendk
mortendk / snippets.cson
Created October 30, 2015 17:05
atom snippets for drupal twig
# Your snippets
#
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to
# expand the prefix into a larger code block with templated values.
#
# You can create a new snippet in this file by typing "snip" and then hitting
# tab.
#
# An example CoffeeScript snippet to expand log to console.log:
#
# Your snippets
#
# https://www.hongkiat.com/blog/add-custom-code-snippets-atom/
'.source.yaml':
'':
'prefix': 'config-fractal'
'body':"""
#title:
#label:
@mortendk
mortendk / cssdropdown-4levels.html
Created December 14, 2011 13:46
CSS Drop Down Menu 4 levels
<!doctype html>
<!--[if IE 7]> <html class="ie7" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="ie8" lang="en"> <![endif]-->
<head>
<title>CSS Drop Down Menu</title>
<style type="text/css" media="screen">
/* ------------------------------------------------------------------
Dropdown widget
@mortendk
mortendk / themenameinfo.yml
Created May 18, 2016 19:06
tell modernizr to fuck out of your theme in drupal 8
libraries-override:
core/modernizr: false
@mortendk
mortendk / menu--main.html.twig
Created May 9, 2016 01:11
complete menu link control to the max Drupal twig
{% import _self as menus %}
{#
We call a macro which calls itself to render the full tree.
@see http://twig.sensiolabs.org/doc/tags/macro.html
#}
{{ menus.menu_links(items, attributes, 0) }}
{% macro menu_links(items, attributes, menu_level) %}
{% import _self as menus %}