I used to have a 5.x theme with a block region defined inside node.tpl instead of page.tpl.
It gave me additional freedom of inserting blocks between main node content and secondary information like $links, $submitted, $terms
No I'm upgrading to 6.x and I can't make this work any more
I've defined regions in a new fashion, adding
...
regions[content_bottom] = ContentBottom
to my_theme.info
and
<?php print $content_bottom; ?>
to my node.tpl.php
The region shows in list at /admin/build/block (but not as a named visual block, as the rest - but this was the case in 5.x, I consider it an expected behavior)
and I can assign blocks to it, but they never show on any actual node-type pages.
So I'm confused - is that some problem with my setup or this possibility was removed in Drupal 6? Anyone did the same in Drupal 6? Any hints?
Comments
ok, so I also had to put
ok, so I also had to put preprocessing like this:
then it works
Hi, me also facing the same
Hi, me also facing the same problem
please say me where to add this below code
you can add this piece of code to template.php
you can add this piece of code to template.php .
Hope this link helps http://drupal.org/node/223430
This one http://drupal.org/node/337022 is for the nodes
Thanks
Juned Kazi
is this is right?
is this is right?
I had serious problems with
I had serious problems with this snippet - for some reason Drupal drops respect to node ordering when I've added this, and while using custom blocks and module blocks. Removing the snippet returned ordering back to normal.
Instead I had to print theme('blocks', $region) in a particular node template (ie node-content_type.tpl.php) where I wanted the region.
Is this correct to create a
Is this correct to create a region in node-product.tpl.php?
This code in theme.info
regions[related_reports]= Related Report
This code in template.php
This code in node-product.tpl.php
Done! Thank's for you
Done!
Thank's for you replay,
Problem was with my node.tpl file
Fixed it!
Could you tell us, which code
Could you tell us, which code you finally used in your template.php?
...
The above convoluted methods are unnecessary:
Replace "themeName" with the name of your theme and "custom_region" with the machine name of your region.
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.
thanks
Thank you for the quick answer. I tried this but it still doesn't appear anywhere in my node. I put this code at the end of my template.php:
(without the php-tags).
In my info-file I added this line:
regions[below_content] = below content
My node.tpl contains this:
print $below_content
And in my admin section I dropped the Fivestar-rating in the "below_content" region.
But this doesn't work...
...
clear your cache, else you've done something, its how it works, done this a million times...
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.
No idea what to do, I tried
No idea what to do, I tried this now several times and nothing happens... I'll let you know when I get it to work. But thanks anyhow.
Really great! This is I need.
Really great! This is I need. thank all eveyone 4 shared !
[url=http://simulationempruntimmobilier.com/][color=#FFFFFF][u]calcul pret assurance simulation taux emprunt
immobilier[/u][/color][/url][color=#FFFFFF] - Taux emprunt immobilier. Comparez les offres d’emprunt immobilier, simulation emprunt immobilier, taux emprunt immobilier[/color][url=http://simulationempruntimmobilier.com/][color=#FFFFFF][u]calcul pret assurance simulation taux emprunt immobilier[/u][/color][/url]
How do you get default blocks back?!
When I added my custom block region, all of the regular block regions vanished, leaving me with only my custom block region. Do I have to add every standard block region back into the template manually? Or is there an easier way? Any advice will be appreciated!
In the info file if you
In the info file if you declare one region, you must delcare them all, my guess is no regions were defined in your info file. In this case the defaults are used - header, footer, sidebars and content - you must re-declare all these if you declare even one of them or another custom region.
this is in the theming docs, please read the theme docs before posting (yeah, right, like thats gonna happen...)
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.
I'll definitely go to the documentation
Thank you for your time and patience with my question. I figured that was the case, but now I at least know that I added the custom region correctly. To the documentation (onward and forward)...
I guess u must have used the
I guess u must have used the function twice... coz thr is already a function present in the template.php .... you would have copy pasted the given piece of code again ... which will give an error ... blank page
Instead u just needed to add the code inside the function (which is already thr) ... in the template.php
this might be a case ....
Try this
FL4PJ4CK
This code given above didn`t work for me too:
then try this:
use "phptemplate" instead of your theme name. I think it depends on your theme which of two variants willl work...
Jeff Burnz method works. Make
Jeff Burnz method works. Make sure not to repeat my mistake by adding print $custom_region in page.tpl too.
Thanks
Problem is in info file...
Just deal with same thing. Problem is in info-file. You shouldn't use "_" for region machine name. To make it work after changing this, please empty your cache.
Can I just say that I love
Can I just say that I love you? Works perfect, thank you so much!
I get the following
I get the following error:
Warning: Call-time pass-by-reference has been deprecated in [...]/template.php on line 112
I am trying to find a solution.
try in your php.ini set -
try in your php.ini set - allow_call_time_pass_reference to on. Or in .htaccess - php_value allow_call_time_pass_reference 1, or may be do not use this "&" with $vars.
This solution worked for me
http://www.pixelclever.com/how-insert-a-block-a-tpl-or-content-programma...
Got this working
Many thanks to Jeff Burnz for his contribution.
I got this working in no time by adding his code to the template.php, node.tpl.php and specifying my regions in the theme info file.
Low php memory alternative
This is great, but when i have the
code in the template.php this alone produces a 'Fatal error: Allowed memory size of 67108864 bytes exhausted' error. Even without specifying the code in the node.tpl.php file.
Any ideas on how to print a specific region with out loading all the others and thus minimizing the php memory load?
You shouldn't call a very
You shouldn't call a very expensive system_region_list(). Instead, add your own defined node regions array, then do the loop for those only regions.
love, light n laughter
add block in node.tpl.php drupal 6
I have been spent many hours searching for this information. Finally this is how i got it.
Add custom region or specific block in node.tpl.php or any custom node-content-type.tpl.php.
Step 1:-
First let us define the region in the theme info file.
regions[custom] = Custom Block
Step 2:-
Now add your custom region to the node.tpl.php or node-content-type.tpl.php.
print $custom;
Step 3:-
Create the preprocess_node function in template.php file in your theme folder
/**
* preprocess hook to add variables to the node.tpl.php
*/
function themename_preprocess_node(&$variables) {
$variables['custom'] = theme('blocks', 'custom');
}
Regards,
Praveen Karan