Closed (fixed)
Project:
Drupal core
Component:
theme system
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
21 Aug 2005 at 01:49 UTC
Updated:
5 Oct 2005 at 17:00 UTC
Jump to comment: Most recent file
if admin chooses no logo in theme config, bluemarine still lays down an img tag which points back to the site home page. thats a sure way to increase your load and bandwidth. yikes!
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | logo_3.patch | 1.68 KB | Uwe Hermann |
| #7 | logo_2.patch | 1.48 KB | chx |
| #6 | logo_1.patch | 1.43 KB | Uwe Hermann |
| #2 | logo_0.patch | 791 bytes | Uwe Hermann |
| logo.patch | 830 bytes | moshe weitzman |
Comments
Comment #1
moshe weitzman commentedpushbutton already avoids this mistake so i copied its code.
Comment #2
Uwe Hermann commentedThe patch is broken. Here's a fixed one.
Comment #3
anders.fajerson commentedWhen your at it: shouldn't
,
etc. be wrapped with
to remove the empty
Comment #4
anders.fajerson commentedMy mistake :) I meant:
Shouldn't
<div class='site-slogan'>... </div>,<div id="secondary">... </div>etc. be wrapped with <? php if ... ?> to remove the empty when not in use. Cleaner XHTML output. Or is it too expesive to check that for each div?Comment #5
anders.fajerson commented... wrapped with
<?php if ... ?>...sorry... BTW, the preview function doesn't work :)
Comment #6
Uwe Hermann commentedSure, why not. I don't think performance will suffer too much. Here's an updated patch.
Comment #7
chx commentedThe patch was OK but was not from Drupal directory. I rerolled and I think it's a go.
Comment #8
dries commentedCan we write "normal" if-statements with curly brackets? It's more consistent with the rest of the template(s). It's not clean to mix both styles.
Comment #9
Bèr Kessels commentedI have only ever seen the
if ($foo):veriosn in phptemplate themes, Dries. CHXs version only follows this de-facto coding-standard.Comment #10
adrian commentedWhen i wrote the first template, i took the time to read up on other systems using php for templating, and from what i've read .. and from my experience ... the : method is simpler for newbies to understand.
There's no specific reason we can't use {} , other than counting brackets inside tag soup can get hairy =)
Comment #11
robertdouglass commented+1 for the : syntax. I'd like to see it used everywhere.
Comment #12
Uwe Hermann commentedOK, lets see if Dries agrees.
Comment #13
dries commentedI think using { } is better but I don't feel strong about it. My point is that we're mixing both styles:
(Random example taken from the same template file,
themes/bluemarine/page.tpl.php.)Comment #14
Uwe Hermann commentedOK, new patch only using { }.
Comment #15
anders.fajerson commentedAs a non php coder I agree with adrian that
<?php if ($foo): ?>is esier to read/understand. The closing<?php endif; ?>makes more sense than<?php } ?>Another argument could be that that wordpress themes use it...But of course whats really matters is consistency.
Comment #16
kbahey commentedI find that when writing code in php-only modules, the curly brace is more natural, and clear.
But when writing PHP intermixed with HTML (e.g. phptemplate theme, and others themes), the alternate syntax is much more readable
if ($something) :HTML Code goes here
endif;I would rather that themes use the alternate syntax just because it is easier to see than a single }.
Comment #17
dries commentedCommitted to HEAD. Thanks.
Comment #18
(not verified) commentedComment #19
(not verified) commentedComment #20
(not verified) commented