theme

By Phil Frilling, 19 August, 2016
Adding placeholder text to a Drupal 8 form element that is the label of the form can be done in your .theme file with the hook template_preprocess_input().


/**
 * Implements template_preprocess_input().
 */
function MYTHEME_preprocess_input(&$variables) {
  // Set a placeholder for all search form elements.
  if ($
By Phil Frilling, 6 September, 2012
I ran into an issue today where I needed to get a themed views title from within a views row style template file (tpl). I tried using drupal_get_title() and menu_get_item() but the title elements were all blank for these. Next I inspected the $views object looking for the themed title but it was not listed. Finally, I discovered within $views->build_info the title and substitutions variables.