Run the following:
$ pod repo remove master
$ pod setup
$ pod install
| // Creates a UIColor from a Hex string. | |
| func colorWithHexString (hex:String) -> UIColor { | |
| var cString:String = hex.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()).uppercaseString | |
| if (cString.hasPrefix("#")) { | |
| cString = cString.substringFromIndex(1) | |
| } | |
| if (countElements(cString) != 6) { | |
| return UIColor.grayColor() |
| /** | |
| * Display a day view. | |
| */ | |
| function template_preprocess_calendar_day(&$vars) { | |
| $vars['view']->style_with_weekno = FALSE; | |
| $view = $vars['view']; | |
| $rows = $vars['rows']; | |
| $item_count = 0; | |
| $by_hour_count = 0; |
| /** | |
| * Replace Panopoly layouts with Radix Layouts | |
| * @param $plugin | |
| * @param $info | |
| */ | |
| function radix_ctools_plugin_post_alter(&$plugin, &$info) { | |
| // If Radix Layouts module is installed. | |
| // Switch all Panopoly Panels layouts to Radix Layouts. | |
| if (module_exists('radix_layouts')) { | |
| $radix_layouts_path = drupal_get_path('module', 'radix_layouts'); |
Run the following:
$ pod repo remove master
$ pod setup
$ pod install
| Download and enable radix: drush en radix -y; drush vset theme_default radix | |
| Create a subtheme: drush cc all; drush radix "Subtheme" | |
| Set default theme: drush en subtheme -y; drush vset theme_default subtheme | |
| Install required modules: cd /path/to/subtheme; npm run setup | |
| Update browserSyncProxy in /path/to/subtheme/config.json | |
| Watch: gulp |
| <?php | |
| /** | |
| * Implements hook_forms(). | |
| */ | |
| function node_ajax_loader_forms($form_id, $args) { | |
| $forms = array(); | |
| if (strncmp($form_id, 'node_ajax_loader_form_', 22) === 0) { | |
| $forms[$form_id] = array('callback' => 'node_ajax_loader_form'); | |
| } |
| <?php | |
| use Drupal\user\RoleInterface; | |
| // Allow anonymous and authenticated users to access contact form. | |
| user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, array('access site-wide contact form')); | |
| user_role_grant_permissions(RoleInterface::AUTHENTICATED_ID, array('access site-wide contact form')); |
| <?php | |
| use Drupal\field\Entity\FieldConfig; | |
| $info = FieldConfig::loadByName($entity_type, $bundle, $field_name); | |
| {% for key, child in element if key|first != '#' %} | |
| <div>{{ child }}</div> | |
| {% endfor %} |