Hello,
I've got a site running on Drupal 5.7 that sticky just doesn't work with. I've got 5 other sites using the same Drupal installation and none of them have this problem. I'm using a custom theme on that one, and I can't help but think it has something to do with the template. But, I have absolutely no idea where to even start on this one.
Any ideas why Stick at top wouldn't work? (it does this for all content types)
- jody
Quoting Jody Cleveland cleveland@winnefox.org:
Hello,
I've got a site running on Drupal 5.7 that sticky just doesn't work with. I've got 5 other sites using the same Drupal installation and none of them have this problem. I'm using a custom theme on that one, and I can't help but think it has something to do with the template. But, I have absolutely no idea where to even start on this one.
Any ideas why Stick at top wouldn't work? (it does this for all content types)
Does the template have any $sticky php elements?
Earnie -- http://for-my-kids.com/ -- http://give-me-an-offer.com/
As best I can tell, there is no $sticky template variable. When the <node> page is being generated, the code looks at the sticky setting in the database and puts them at the top of the list. There isn't a variable just for sticky items.
Steve
Earnie Boyd wrote:
Quoting Jody Cleveland cleveland@winnefox.org:
Hello,
I've got a site running on Drupal 5.7 that sticky just doesn't work with. I've got 5 other sites using the same Drupal installation and none of them have this problem. I'm using a custom theme on that one, and I can't help but think it has something to do with the template. But, I have absolutely no idea where to even start on this one.
Any ideas why Stick at top wouldn't work? (it does this for all content types)
Does the template have any $sticky php elements?
Earnie -- http://for-my-kids.com/ -- http://give-me-an-offer.com/
Quoting Steve Edwards killshot91@comcast.net:
As best I can tell, there is no $sticky template variable. When the <node> page is being generated, the code looks at the sticky setting in the database and puts them at the top of the list. There isn't a variable just for sticky items.
There is a variable $sticky used in the node.tpl.php file of the garland theme which is why I asked.
Earnie -- http://for-my-kids.com/ -- http://give-me-an-offer.com/
Yes, I noticed that, too. I said that because I looked in the handy-dandy Chapter 8 of the 'Pro Drupal Development' book, and there is no $sticky variable listed for any template. The Garland theme doesn't appear to add the variable in template.php, either, so I'm not sure where it's coming from.
Steve
Earnie Boyd wrote:
Quoting Steve Edwards killshot91@comcast.net:
As best I can tell, there is no $sticky template variable. When the <node> page is being generated, the code looks at the sticky setting in the database and puts them at the top of the list. There isn't a variable just for sticky items.
There is a variable $sticky used in the node.tpl.php file of the garland theme which is why I asked.
Earnie -- http://for-my-kids.com/ -- http://give-me-an-offer.com/
Quoting Steve Edwards killshot91@comcast.net:
Yes, I noticed that, too. I said that because I looked in the handy-dandy Chapter 8 of the 'Pro Drupal Development' book, and there is no $sticky variable listed for any template. The Garland theme doesn't appear to add the variable in template.php, either, so I'm not sure where it's coming from.
Sure seems to me that it should be $node->sticky instead but variables get created variably as well as constantly so finding where in the code $static is created is a bit of a chore unless you just happen to know.
I use the B7 and it uses $sticky in the node.tpl.php file and I know it works because the base.css changes the background color. This tells me that $sticky is a global variable that is available even though the documented variables don't give it as one. This of course isn't advised normally but even the node.tpl.php file of themes/engines/phptemplate contains $sticky so it has been propagated via copy.
Earnie -- http://for-my-kids.com/ -- http://give-me-an-offer.com/
Earnie,
$node->sticky works, but is not required. Please read this page from the Theme Developer's Guide:
Marc
Earnie Boyd wrote:
Quoting Steve Edwards killshot91@comcast.net:
Yes, I noticed that, too. I said that because I looked in the handy-dandy Chapter 8 of the 'Pro Drupal Development' book, and there is no $sticky variable listed for any template. The Garland theme doesn't appear to add the variable in template.php, either, so I'm not sure where it's coming from.
Sure seems to me that it should be $node->sticky instead but variables get created variably as well as constantly so finding where in the code $static is created is a bit of a chore unless you just happen to know.
I use the B7 and it uses $sticky in the node.tpl.php file and I know it works because the base.css changes the background color. This tells me that $sticky is a global variable that is available even though the documented variables don't give it as one. This of course isn't advised normally but even the node.tpl.php file of themes/engines/phptemplate contains $sticky so it has been propagated via copy.
Earnie -- http://for-my-kids.com/ -- http://give-me-an-offer.com/
Quoting Marc Poris marc@funnymonkey.com:
Earnie,
$node->sticky works, but is not required. Please read this page from the Theme Developer's Guide:
Many thank-yous for the pointer. I was reading the code but had not found the setting for $sticky. I know it must happen as a result of globalizing some of the parameters of the node object.
Earnie -- http://for-my-kids.com/ -- http://give-me-an-offer.com/
On 3/7/08 10:37 AM, "Earnie Boyd" earnie@users.sourceforge.net wrote:
Quoting Jody Cleveland cleveland@winnefox.org:
Hello,
I've got a site running on Drupal 5.7 that sticky just doesn't work with. I've got 5 other sites using the same Drupal installation and none of them have this problem. I'm using a custom theme on that one, and I can't help but think it has something to do with the template. But, I have absolutely no idea where to even start on this one.
Any ideas why Stick at top wouldn't work? (it does this for all content types)
Does the template have any $sticky php elements?
I have this at the top of node.tpl.php:
<div id="node-<?php print $nid ?>" class="node<?php print ($sticky && $page == 0) ? " sticky" : ""; ?><?php print ($page == 0) ? " teaser" : " "; ?><?php print ' ' . ($node->type); ?><?php print ($submitted && !$page) ? " cal" : ""?>">
Quoting Jody Cleveland cleveland@winnefox.org:
On 3/7/08 10:37 AM, "Earnie Boyd" earnie@users.sourceforge.net wrote:
Quoting Jody Cleveland cleveland@winnefox.org:
Hello,
I've got a site running on Drupal 5.7 that sticky just doesn't work with. I've got 5 other sites using the same Drupal installation and none of them have this problem. I'm using a custom theme on that one, and I can't help but think it has something to do with the template. But, I have absolutely no idea where to even start on this one.
Any ideas why Stick at top wouldn't work? (it does this for all content types)
Does the template have any $sticky php elements?
I have this at the top of node.tpl.php:
<div id="node-<?php print $nid ?>" class="node<?php print ($sticky && $page == 0) ? " sticky" : ""; ?><?php print ($page == 0) ? " teaser" : " "; ?><?php print ' ' . ($node->type); ?><?php print ($submitted && !$page) ? " cal" : ""?>">
Hmm... Can you change which theme you're using to eliminate possibilities? If you want just activate say garland, go to the user/1/edit and then choose the theme to use. If it works for garland it is a theme issue for sure. If not then look at the installed modules to try to determine which one might be causing an issue.
Earnie -- http://for-my-kids.com/ -- http://give-me-an-offer.com/
The $sticky variable gets set automatically by the phptemplate engine in phptemplate_node() where the comment says "Flatten the node object's member fields" -- it's not the problem in this case, but verifying that the same thing happens when using another theme is always a good idea.
Check these things:
1. Have you overridden the 'node' view using the Views module? If so, are you sorting first by Sticky? 2. Do you have a separate front page that's showing the nodes, or is this happening on all node listings (ie. via Taxonomy, etc...)? 3. Are you sure there are some nodes set to 'sticky'? 4. Are those nodes also published? 5. Does the viewing user have access to the sticky nodes (has another access control module been installed that may be hiding these nodes)?
Marc
Jody Cleveland wrote:
On 3/7/08 10:37 AM, "Earnie Boyd" earnie@users.sourceforge.net wrote:
Quoting Jody Cleveland cleveland@winnefox.org:
Hello,
I've got a site running on Drupal 5.7 that sticky just doesn't work with. I've got 5 other sites using the same Drupal installation and none of them have this problem. I'm using a custom theme on that one, and I can't help but think it has something to do with the template. But, I have absolutely no idea where to even start on this one.
Any ideas why Stick at top wouldn't work? (it does this for all content types)
Does the template have any $sticky php elements?
I have this at the top of node.tpl.php:
<div id="node-<?php print $nid ?>" class="node<?php print ($sticky && $page == 0) ? " sticky" : ""; ?><?php print ($page == 0) ? " teaser" : " "; ?><?php print ' ' . ($node->type); ?><?php print ($submitted && !$page) ? " cal" : ""?>">