Hi,

I installed phptemplate and Blumarine for phptemplate.

However, it has very serious bugs in node display. You can see what I mean here and here.

Everything is ok on the homepage, but when you click on a node to read it, you see grey background if it is sticky, and not white as it appears with Bluemarine xtemplate. Also, when you click on a node to see it, you see twice its title, and one title is clickable, which is totally wrong and this does not happen with bluemarine for xtemplate.

CommentFileSizeAuthor
#10 nskdiff475 bytesnsk
#6 node.tpl_0.php586 bytesnsk
#4 node.tpl.php533 bytesnsk
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nsk’s picture

The double title bug is related to the Taxonomy Menu module, but the gray background if sticky in node view bug is not related to Taxonomuy Menu,

nsk’s picture

I fixed the sticky bug. Here is the code: in node.tpl.php for 4.6:

$mypagecheck = variable_get('site_frontpage', 'node'); if ($mypagecheck == $_GET['q']) { if ($sticky) { print " sticky"; } } ">
 if ($picture) { 
      print $picture;
    }

print $node_url"> print $title

print $submitted
print $terms

print $content
nsk’s picture

node.tpl.php:

$mypagecheck = variable_get('site_frontpage', 'node'); if ($mypagecheck == $_GET['q']) { if ($sticky) { print " sticky"; } }
nsk’s picture

FileSize
533 bytes

see attach

nsk’s picture

the patch I uploaded has a smaller bug, too: taxonomy pages don't get stickies, I am working on this...

nsk’s picture

FileSize
586 bytes

hey I solved the taxonomy bug too!

robertDouglass’s picture

If you could generate a patch from this it would be useful. Thanks.

nsk’s picture

I have an account in the contribs repository so I think maybe I could update the CVS directly if you want me to do so.

nsk’s picture

--- node-original.tpl.php 2004-12-26 04:25:08.000000000 +0200
+++ node-bugfix.tpl.php 2005-08-03 21:40:53.000000000 +0300
@@ -1,4 +1,4 @@
-

if ($sticky) { print " sticky"; } ">
+
$myhomecheck = variable_get('site_frontpage', 'node'); $mytaxocheck = arg(0); if ($myhomecheck == $_GET['q'] || $mytaxocheck == 'taxonomy') { if ($sticky) { print " sticky"; } } ">
 if ($picture) {
       print $picture;
     }
nsk’s picture

FileSize
475 bytes

I wish I could paste raw text. See the file

nsk’s picture

I documented my bugfix, here

nsk’s picture

hey in the taxocheck add "|| $mytaxocheck == 'taxonomy_menu'" to make the background colour work even in taxonomy menu.

gordon’s picture

Priority: Critical » Normal
Status: Active » Closed (won't fix)

I have looked at the issue that has been described, and I have also looked at other phptemplate themes. bluemarine respects the sticky flag unconditionally.

You can alter this in your copy of bluemarine but then you have a non-standard version. If you consider this a problem then it is the phptemplate engine that is passing the $sticky flag incorrectly and should be fixed in their so all other phptemplate themes have this fix as well.

nsk’s picture

The fact that the bug is in PHPTemplate does not mean that you should allow it
to propagate within the theme. There is nothing wrong with fixing an engine
bug on the theme level. When the person responsible for PHPTemplate fixes the
bug there, you will just provide a new version of Bluemarine without the
theme-level extra fix. The user does not care where the bug is or what causes
it, not ever whether the bug appears in other themes and other sites, they
care only about correct HTML output in their own website, and that's what we
should strive to provide. Since our code is used on production sites we
should first try to provide proper output, then do the right job inside the
code. So, if we cannot fix the PHPTemplate bug right now, we should apply a
theme-level fix, as I do on http://portal.wikinerds.org/

The fix in node.tpl.php is easy:

<div class="node<?php $myhomecheck = variable_get('site_frontpage', 'node'); 
$mytaxocheck = arg(0); if ($myhomecheck == $_GET['q'] || $mytaxocheck == 
'taxonomy' || $mytaxocheck == 'taxonomy_menu') { if ($sticky) { print " 
sticky"; } } ?>">

I built that code based on information from #drupal and what I do is just
checking the URL to see whether we are in the main page or in a taxonomy page
or in a taxonomy_menu page. If that's true then the normal sticky code
executes.