This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function Autostock2014_language_switch_links_alter(&$links, $type, $path) { | |
| foreach ($links as &$language) { | |
| $language['title'] = $language['language']->language; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /***************** | |
| ** BAD PRACTICE ** | |
| *****************/ | |
| <img src="<?php print file_create_url($node->field_image['und'][0]['uri']); ?>" /> | |
| /************* | |
| ** USE THIS ** | |
| *************/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $view = new view(); | |
| $view->name = 'garages'; | |
| $view->description = ''; | |
| $view->tag = 'default'; | |
| $view->base_table = 'node'; | |
| $view->human_name = 'Garages'; | |
| $view->core = 7; | |
| $view->api_version = '3.0'; | |
| $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-extraAllowedContent | |
| // /admin/config/content/ckeditor/edit/Full | |
| config.allowedContent = true; | |
| config.extraAllowedContent = 'span'; | |
| config.removeFormatAttributes = 'align,hspace,valign'; // Defaults to: 'class,style,lang,width,height,align,hspace,valign' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // https://www.drupal.org/node/295383 | |
| <?php print flag_create_link('flag_machine_name', $node->nid); ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Via http://drupal.stackexchange.com/questions/42352/display-number-of-times-content-is-referenced-in-content | |
| This video series helped me an infinite amount: http://vimeo.com/33251051, http://vimeo.com/33252553. | |
| Make sure Child has an entity reference to Parent. | |
| Create a new view | |
| In Filter Criteria, add a new Type (= Parent) | |
| In Advanced>Other, set Aggregation to YES | |
| In Advanced>Relationships, add a new relationship for "A bridge to the Content entity that is referencing Content via field_parent" where field_parent is your entity reference. Call this "Parents" | |
| In Fields, add Content: Title and when prompted set its Aggregation type to Group results together |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Berghoff2014_form_alter(&$form, &$form_state, $form_id) { | |
| if( $form_id === "webform_client_form_33" ) { | |
| /** | |
| ** Replace NID from Agent with actual email ** | |
| **/ | |
| //$node_id = $form['submitted']['agent']['#value']; | |
| $node_id = arg(1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function THEME_NAME_css_alter(&$css) | |
| { | |
| unset($css[drupal_get_path('module', 'system').'/system.theme.css']); | |
| unset($css[drupal_get_path('module','system').'/system.base.css']); | |
| unset($css[drupal_get_path('module', 'system').'/system.messages.css']); | |
| unset($css[drupal_get_path('module', 'comment').'/comment.css']); | |
| unset($css[drupal_get_path('module', 'field').'/theme/field.css']); | |
| unset($css[drupal_get_path('module', 'mollom').'/mollom.css']); | |
| unset($css[drupal_get_path('module', 'node').'/node.css']); | |
| unset($css[drupal_get_path('module', 'search').'/search.css']); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $content['field_name'][0]['#item']['attributes']['attribute_name'] = 'value'; | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function hook_form_alter(&$form, &$form_state, $form_id) { | |
| if( $form_id === "webform_client_form_nn" ) { // Update with actual form id | |
| $node_id = $form['submitted']['wagen']['#value']; // Define a field in webform that takes a get value as default | |
| $node = node_load( $node_id ); | |
| // If a node has been specificied via its nid (cid in url), we prefill the request field with the name and url of the car |