Closed (fixed)
Project:
FriendsElectric
Version:
4.6.x-1.x-dev
Component:
Browser bugs
Priority:
Minor
Category:
Bug report
Assigned:
Reporter:
Created:
16 May 2005 at 19:32 UTC
Updated:
31 May 2005 at 01:15 UTC
The Primary/Secondary Link lists are started whether or not there are links to be displayed. This creates a validation error since unordered lists must contain items.
26: <div id="top-nav">
27: <ul id="primary">
28: </ul>
29:
30: <ul id="secondary">
31: </ul>
32: </div>In /themes/friendselectric/page.tpl.php
<div id="top-nav">
<?php if (is_array($primary_links)): ?>
<ul id="primary">
<?php foreach ($primary_links as $link): ?>
<li><?php print phptemplate_wrap_links($link, 2); ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<?php if (is_array($secondary_links)): ?>
<ul id="secondary">
<?php foreach (array_reverse($secondary_links) as $link): ?>
<li><?php print phptemplate_wrap_links($link, 2); ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</div>Is patched to --->
<div id="top-nav">
<?php if (is_array($primary_links) && !empty($primary_links)): ?>
<ul id="primary">
<?php foreach ($primary_links as $link): ?>
<li><?php print phptemplate_wrap_links($link, 2); ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<?php if (is_array($secondary_links) && !empty($secondary_links)): ?>
<ul id="secondary">
<?php foreach (array_reverse($secondary_links) as $link): ?>
<li><?php print phptemplate_wrap_links($link, 2); ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</div>Patch is provided.
Let me know if something is wrong, since this is my first patch.
-Alan
P.S. Is there any reason the entire "top-nav" div shouldn't be displayed when there are no links? I didn't want to do this since I wasn't sure if it would break anything.
Comments
Comment #1
altano commentedUgh, why can't I attach this patch? Let's try this again...
Comment #2
altano commentedWow it just won't let me attach this patch!
Here is a link to it off my site:
http://www.terriblefish.com/files/page_tpl_php_patch.txt
If someone could d/l it, rename it, and upload it, that would be cool (or tell me what i'm doing wrong).
Comment #3
Steven commentedFixed in HEAD and 4.6. About the upload problems, it wasn't your fault, there was a problem with a recent patch to CVS which caused problems with the drupal.org set up. It should be fixed now.
Comment #4
(not verified) commented