SearchRecent posts
The Random ToolboxDrupal 7 Setting up variables for use in a template (preprocess and process functions) Rendering Drupal 7 fields (the right way) Linux Secure Copy (scp) command Restrict Free Shipping in Magento Quickbooks Text Connection Ticket Cross-Site Request Forgery (CSRF) jQuery Events: MouseOver / MouseOut vs. MouseEnter / MouseLeave Monthly archive
|
Drupal 7 Custom Views Layout - theme_preprocess_views_view_fields()function NAME-OF-THEME_preprocess_views_view_fields(&$vars, $hook){ // machine name of view if ($vars['view']->name == 'homepage_slideshow') { // add a wrapper before a certain field $vars['fields']['field_slide_image']->wrapper_prefix = '<div class="slideshow-content-wrapper-left">' . $vars['fields']['field_slide_image']->wrapper_prefix; // add a wrapper after the same field $vars['fields']['field_slide_image']->wrapper_suffix .= '</div>'; // add a wrapper before a certain field $vars['fields']['title']->wrapper_prefix = '<div class="slideshow-content-wrapper-right">' . $vars['fields']['title']->wrapper_prefix; // add the closing tag for the wrapper we created above $vars['fields']['field_button_link']->wrapper_suffix .= '</div>'; } } |