18th February 2011
I just had a problem with the date field in an exposed filter in a Drupal view, using the “popup” form type. Regardless of the site configuration date format, the exposed filter will always default to the format Y-m-d. I ended up fixing this by creating a new module, and wrote a simple function using the form_alter hook:
function exposed_date_format_form_views_exposed_form_alter(&$form, &$form_state) {
if ($form['#id'] == 'your exposed form ID') {
$form['your date field name']['min']['#date_format'] = 'd-m-Y';
$form['your date field name']['max']['#date_format'] = 'd-m-Y';
}
}
I often develop sites on my local machine before committing and transferring to a staging/live server, so during the development phase most of my sites reside on a URL similar to http://localhost:8800. …
17th May 2011
read more »I was just developing a Block View in Drupal for a freelance project, where the markup on the first row was different to the subsequent rows. I needed to change the markup to display an image and teaser, while the subsequent rows just has the title (which links to the node) and published date. …
13th April 2011
read more »Being able to sort a view using URL parameters seems like the most basic functionality, but it seems this is not possible using using views without some kind of module. I have to say Symphony handles this much better than Drupal. …
10th March 2011
read more »I often like to use template files to alter the HTML of a view to cut down on the masses of redundant markup that Drupal creates. But I just came across a problem where I was unable to get the file path of an image in my content type, despite the fact that the image was output in the view settings. …
8th March 2011
read more »