The Block Function of Drupal can be embedded in HTML and PHP code. It is convenient and flexible to control display based on permission and URL matching. However, it is a habit to use the layout format of mediawiki, it is sometimes inconvenient to add a block under the title (the header block is at the top of the page by default ).
A few days ago, I knew that more blocks can be added in addition to the default block location of the garland topic in Drupal, but I have not tried it. I tried it today and it is very convenient to implement it, the following three steps are recorded:
Step 1: Modify the Template File
Modify the Page Template File page. TPL. php In the garland topic directory and insert the added variable:
<? PHP Print $ help;?>
<Div class = "Clear-block">
<? PHP Print $ top?> // Add the variable $ top above the content
<? PHP Print $ content?> // The original content variable $ content
<? PHP Print $ bottom?> // Add the variable $ bottom below the content
</Div>
<? PHP Print $ feed_icons?>
After the modification is saved, it does not take effect. You also need to modify the registration file:
Part 2: Modify the registration file
Modify the registration file garland.info In the garland topic directory and insert the new variable:
Regions [left] = left sidebar
Regions [right] = right sidebar
Regions [content] = content
Regions [header] = Header
Regions [footer] = footer
Regions [Top] = Top
Regions [bottom] = bottom
In addition to the two rows added at the bottom, note that the upper five rows contained by default are also written in; otherwise, the previous area blocks will disappear.
Part 3: refresh cache and start using
Then, you need to refresh the cache. The modified garland.info will take effect. After the refresh takes effect in the management menu, the newly added two regions can be displayed and placed in the same block as the previous five regions.
The above method can be used normally in Drupal 6. XX.
Http://jamesqi.com/%E5%8D%9A%E5% AE %A2/Drupal%E4%B8%AD%E6%B7%BB%E5%8A%A0%E8%87%AA%E5% AE %9A%E4%B9%89%E5%8C%BA%E5%9F%9F (region) % E6 % 94% be % E7 % BD % AE % E5 % 8C % Ba % E5 % 9d % 97 (Block)