Skip to content

Instantly share code, notes, and snippets.

View Morasta's full-sized avatar

Matt Viehdorfer Morasta

View GitHub Profile
@Morasta
Morasta / d7_display_suite_hide_labels_function.php
Last active September 2, 2016 02:10
Drupal 7 - Hide labels for empty display suite fields
/**
* Implements hook_field_attach_view_alter().
*
* Hide label of display suite fields if field content is empty.
*/
function cof_directory_field_attach_view_alter(&$output, $context) {
$displaySuiteFields = array("graduate_students","office_location");
foreach ($output as $field_name => $field) {
if (!empty($field['#label_display'])) {
@Morasta
Morasta / getCurrentBoostrapViewport
Last active August 29, 2015 14:19
Script to print current Bootstrap viewport breakpoint size
<script src="https://rawgit.com/maciej-gurban/responsive-bootstrap-toolkit/master/js/bootstrap-toolkit.min.js"></script>
<script>
function getCurrentVP(viewport) {
var currentViewport= 'n/a';
if( viewport.is('xs') ) {
currentViewport = 'xs';
}
else if( viewport.is('sm') ) {
currentViewport = 'sm';
@Morasta
Morasta / d7_keyvalue_taxonomy_term_list.php
Created May 20, 2015 23:19
Drupal 7 - key/value (machine_name/display_name) taxonomy term list
function keyvalue_taxonomy_term_list($vocabMachineName){
$tax = taxonomy_vocabulary_machine_name_load($vocabMachineName);
$termTree = taxonomy_get_tree($tax->vid);
$terms = array();
foreach ($termTree as $idx => $term) {
$terms[str_replace($vocabMachineName.'/', '', drupal_lookup_path('alias', 'taxonomy/term/'.$term->tid, 'und'))] = $term->name;
}
return $terms;
@Morasta
Morasta / gist:dc98d19645f7ef124e6a7fa662c7b233
Created July 25, 2016 21:16
MACS: Mobile Anchor Capacity System iOS Support Page
The MACS: Mobile Anchor Capacity system app is provided as-is. The full license and EULA is included in the app.
For support inquiries please email web.osha <at> oregon.gov and include "MACS iOS support" in the subject line.