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.
A few small changes are suggested for the template files:
- To avoid unnecessary errors when E_ALL is set higher, instead of doing
if ($var):
it should beif (!empty($var)):
- For template files it is cleaner to use
if (): endif;
and
foreach (): endforeach;
instead of
if () { }
and
foreach () { }
- Because all fields can be enabled / disabled at will via the field settings, all fields should be optional, inc $map_link.
Comment | File | Size | Author |
---|---|---|---|
#2 | location-n896366-2.patch | 4.65 KB | DamienMcKenna |
#1 | location-n896366.patch | 4.65 KB | DamienMcKenna |
Comments
Comment #1
DamienMcKennaHere's a patch that cleans up the tpl files a little bit.
Comment #2
DamienMcKennaSlight correction.
This patch sponsored by Bluespark Labs.
Comment #3
rooby CreditAttribution: rooby commentedThanks for the patch.
Committed with a few minor additions:
* A couple of indenting and spacing changes.
* A slight change also to location_distance.tpl.php
* Change to use format_plural in locations.tpl.php
* Changed a couple of extra echos to prints so they are now all consistent.
* A fix for the following code in the patch from #2:
Province and post code would not display if city was not present.
http://drupal.org/cvs?commit=476314
http://drupal.org/cvs?commit=476310
http://drupal.org/cvs?commit=476312
Powered by Dreditor.
Comment #4
rooby CreditAttribution: rooby commentedMarked #785208: Fix indenting of template files as duplicate of this issue.
Comment #5
DamienMcKennaThanks Rooby.
Comment #6
rooby CreditAttribution: rooby commentedNo worries.
Also committed to DRUPAL-7--3.
http://drupal.org/cvs?commit=478412