drupal theme question (aka attn kingtoad)
I’m trying to add a block region before the first unstickied node on the front page..
I guess I need to make a global variable to use as a flag? and just check it in the node template? does drupal have anything special for global variables?
What version of Drupal are you using? If it’s pre 6, you’ll have to add an override in your template.php file to create a new block region, reference . If it’s version 6 or greater, you declare your new block region in your theme’s .info file, like so:
;regions regions[left] = Left sidebar regions[right] = Right sidebar regions[content] = Content regions[header] = Header regions[footer] = Footer
You implement the block region via:
<?php print $header; ?> <?php print $right; ?> <?php print $content; ?> ...
What version of Drupal are you using? If it’s pre 6, you’ll have to add an override in your template.php file to create a new block region, reference . If it’s version 6 or greater, you declare your new block region in your theme’s .info file, like so:
;regions regions[left] = Left sidebar regions[right] = Right sidebar regions[content] = Content regions[header] = Header regions[footer] = Footer You implement the block region via: <?php print $header; ?> <?php print $right; ?> <?php print $content; ?> ... |
Yeah it’s v6, and yeah I got that part. I’m trying to figure out how to get the print argument between the last stickied node and first unstickied node, though.
I don’t see any way to do it except for creating a global flag variable that is set in the node template during stickied nodes. I could then print the region when the current node is not stickied but the flag variable indicates that the previous node was, etc. Was wondering if you guys have a better way to do it, or if there’s anything special I should know when dealing with global variables in Drupal
Maybe just recreate the page with two views that have a block in between them
Anyone know of a good way to do this, but make pages 2 to whatever shows posts as normal? So the first page of results always is different than the rest?
Yeah it’s v6, and yeah I got that part. I’m trying to figure out how to get the print argument between the last stickied node and first unstickied node, though.
I don’t see any way to do it except for creating a global flag variable that is set in the node template during stickied nodes. I could then print the region when the current node is not stickied but the flag variable indicates that the previous node was, etc. Was wondering if you guys have a better way to do it, or if there’s anything special I should know when dealing with global variables in Drupal |
Well I know why I couldn’t get it to work this way..
However, region variables haven’t been defined for templates at the block and node and view levels. |
Well I know why I couldn’t get it to work this way..
|
Yeah. Abstraction. I came across this problem a few times. You can technically create a function in your template.php file to get your data and pass it to your theme as needed though.
Yeah. Abstraction. I came across this problem a few times. You can technically create a function in your template.php file to get your data and pass it to your theme as needed though.
|
started to look into it.. seems like a pain in the ass. I’ll just changed my plans and use the time already spent as a lesson