I am trying to modify the draft comment form so that I can show an area just above the form and more than that Can add block area (some are called promotional banners).
I am doing this in template.php. I have a function name IEM_comment_form function and can set $ form ['intro'] ['# value']
I want to know how to create a new area for the value
The value of the area that I am struggling is to say the value of that area (say $ above_comment_form
) and make it available in themename_comment_form (like $ form ['intro']. ['#value'] = $ above_comment_form;
) I've tried preprocess_page, preprocess_node to set a destiny on $ vars ['above_comment_form]] = $ up_comment_form
.
To create an area, you must place it in your module's .info
file Must have to add in. If you do not have any defined areas, then default 5 should be available:
- left
- right
- content
- Header
- Footer
If you want to add / remove areas, then you have to write all to the areas you want . To include a custom area, you must place it in your .info
file: fields [header] = "header" field [left] = "left sidebar" field [content] = "content" Field [right] = "right sidebar" area [Footer] = "Footer" area [above_comment_form] = "above comment form"
Now fields only your page.tpl Available in .php
by default. You can get blocks in any area that is available by using the user using theme_blocks
. Therefore, you need to add to your preprocess_node
function:
$ vars ['above_comment_form'] = theme ('block', 'above_comment_form');
Then you can do this in your node.tpl.php:
& lt; Div id = "above_comment_form" & gt; & Lt ;? Php print $ up_comment_form; ? & Gt; & Lt; / Div & gt;
This should accomplish your task.
Comments
Post a Comment