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
| 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
| // 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
| // 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
| $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
| /***************** | |
| ** 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
| <?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
| mysql -u username -p database < file.sql | |
| /******* | |
| ** OF ** | |
| *******/ | |
| mysql -u username -pPASSWORD | |
| > source file.sql; |
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_22") { | |
| // get the nid so we can use it in the wrapper value | |
| $nid = $form['#node']->nid; | |
| // add the ajax properties to the submit button | |
| $form['actions']['submit']['#ajax'] = array( | |
| 'callback' => 'hook_webform_js_submit', // update function |
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
| /** | |
| * $vars['#id''] = Form ID, can be found via Krumo | |
| * $vars['field_name'] = Name of the input element you want to access | |
| */ | |
| function theme_form_alter(&$vars) { | |
| //krumo($vars); | |
| if( $vars['#id'] = " ") { |