Skip to content

Instantly share code, notes, and snippets.

@waako
waako / get_paragraph_type_from_field.php
Last active April 27, 2016 15:28 — forked from jenitehan/get_paragraph.php
Get paragraph type of child field item
<?php
/**
* Implements hook_preprocess_HOOK for field--field-structured-content-section.html.twig
*/
function TEMPLATE_preprocess_field__field_structured_content_section(&$variables) {
$items = $variables['items'];
foreach ($items as &$item) {
$paragraph = $item['content']['#paragraph'];
$para_type = $paragraph->getType();
@waako
waako / field.tpl.php
Created July 20, 2015 14:56
add class to the 1st, and every 3rd and 4th element
<?php $max_delta = count($items) - 1; ?>
<div class="<?php print $classes; ?>"<?php print $attributes; ?>>
<?php if (!$label_hidden): ?>
<div class="field-label"<?php print $title_attributes; ?>><?php print $label ?>:&nbsp;</div>
<?php endif; ?>
<div class="field-items content"<?php print $content_attributes; ?>>
<?php foreach ($items as $delta => $item): ?>
<?php
$classes = 'grid-3 ';
$tmp = $delta % 4;
<?php foreach($rows as $row): ?>
<h3><?php print $row['field_collection_name_title']; ?></h3>
<?php if ($row['field_collection_name_subtitle']): ?>
<?php print render($row['field_collection_name_subtitle']['safe_value']); ?>
<?php endif; ?>
<?php print render($row['field_collection_name_content']['safe_value']); ?>
<?php endforeach; ?>

Keybase proof

I hereby claim:

  • I am waako on github.
  • I am waako (https://keybase.io/waako) on keybase.
  • I have a public key whose fingerprint is D262 BF75 7D2A 87EC 8CB3 6971 8471 78CE AF42 256B

To claim this, I am signing this object:

@waako
waako / questions.md
Last active August 29, 2015 14:05
Technical Interview

work environment

  • Equipment provided/used
  • Platform O/S
  • Office layout

Dev

Workflow

@waako
waako / SassMeister-input.scss
Created June 14, 2014 18:38
Generated by SassMeister.com.
// ----
// Sass (v3.3.8)
// Compass (v1.0.0.alpha.19)
// ----
// Hacking made easy
// ---
// A couple of Sass functions
// To ease the pain of dealing
// With special values for IE
<?php
/*
* Bootstrap override
* make dropdown menus do dropdown on hover,
* and allow parent link to be clickable
*/
// place this in your styles
ul.nav li.dropdown:hover > ul.dropdown-menu{
display: block !important;