No links if comments active
tinthing - May 10, 2007 - 23:29
| Project: | Blue Zinfandel |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
This is a nice theme, very clear for new users and administration. However, I've found that the blue_zinfandel_links() function in template.php which overrides theme_links() completely empties the $links array for any node for which the viewer has comment access. As a result this kills links to stuff like 'Printer Friendly Version', 'Contact Author' etc. Same goes for links related to polls in the poll block.
As a workaround I have just commented this function out.

#1
Well, that's a bug. ;)
Fixed in template.php 1.4.
#2
Fast response! Well, that revived the other links, but the 'Add Comment' link only shows on the front page teaser view (sorry, not familiar with the correct drupalisms yet), not when the node is viewed in full, and never for polls (probably other node types too) with their own blocks. Perhaps the mods to the links array in blue_zinfandel_links() should only be performed for a teaser view (dunno how you'd test for that)?
#3
Hm. Interesting... I can't fix it that way, because I don't have the $node in theme_links. :(
I'll try a node-story.tpl.php way instead.
#4
How about this - remove blue_zinfandel_links() from template.php, and amend node.tpl.php like this...
Replace
<?php if (!$page) { // We're in teaser view ?>| <?php print $comment_link; ?>
<?php }; ?>
with
<?php if (!$page && $comment_link) { // We're in teaser view ?><?php print "| $comment_link"; ?>
<?php }; ?>
and then
<?php if ($links) { ?><div class="links">» <?php print $links?></div><?php }; ?>with
<?php if ($links && $page) { ?><div class="links">» <?php print $links?></div>
<?php }; ?>
Works for me.
#5
Hm. Are you sure commenting out that code fixes the poll block? I can't get links to show up there no matter what I do... also, the CSS is hosing the location of the radio buttons. So I'll go make a separate "poll module needs love" bug.
In the meantime though, I found a much better way to change those links... I'm doing it now in _phptemplate_variables so it only affects node links rather than firing every single time a link list is displayed. D'oh!
#6
Oops. we cross-posted. ;)
That && $comment_link is a good fix... but not really related to the current bug. I don't mind the links showing up in both teaser and full view; I just don't want two "Add comment" links... that's what that theme_links code was doing.
#7