Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have a view with six exposed filters. I wish to wrap two of them in one div and the other four in another div. Is this possible?
I have figured out how to wrap each filter individually and how to wrap the whole bunch of them in a single div., but can't figure out how to split them up between two divs. Thanks.
Comments
Comment #1
dawehnerThere is a template for that http://drupalcode.org/project/views.git/blob/refs/heads/7.x-3.x:/theme/v... you can use.
So you might write some preprocess code that organices them in two groups like that.
and then use these left_widgets in the template file.
Comment #2
gettysburger CreditAttribution: gettysburger commentedThanks. This helps a lot. It will take me a minute to get my head around it, but I really appreciate you pointing me to this.
Comment #3
gettysburger CreditAttribution: gettysburger commentedI have the template file set up and waiting for the $left_widgets variable, but am having trouble withe the template.php file.
I pasted the function into the template.php file and changed
function theme_preprocess_views_exposed_form(&$vars)
to
function zurb_foundation_preprocess_views_exposed_form(&$vars)
and after I refresh the cache I get the WSOD?
The other functions that came in that file by default use $variables instead of $vars. Does that matter? Also, I checked to make sure there were no other function with the same name and there were not. Thanks.
Comment #4
gettysburger CreditAttribution: gettysburger commentedNever mind. I'm an idiot. I made a different syntax mistake.
Comment #5
gettysburger CreditAttribution: gettysburger commentedNot being too up on my PHP, I am a little confused as to how "$left_widgets = array('text', 'type');" tells the foreach statement which fields I want in one of the sections. I am guessing it would select each one that is of the type "text" but am not sure.