Blocks: Difference between revisions
Created page with "You can get rid of blocks in Administer -> structure -> Blocks If you get rid of the login block, you can login using http://edgarbv.com/testing/user" |
No edit summary |
||
Line 6: | Line 6: | ||
http://edgarbv.com/testing/user | http://edgarbv.com/testing/user | ||
= Create a Custom Region = | |||
(1) On your thems folder open the your_theme_name.info file and add a new region like this shown below; | |||
regions[featured_slider] = Featured Slider | |||
and save the .info file. | |||
(2) Open your themes page.tpl.php file and add these code where you want your slide to be displayed as shown below; | |||
<pre> | |||
<?php if ($page['featured_slider']): ?> | |||
<div id="featured-slider"> | |||
<?php print render($page['featured_slider']); ?> | |||
</div> <!-- End Featured Slider--> | |||
<?php endif; ?> | |||
</pre> | |||
You can even create custom front page template like page--front.tpl.php so that you do't need to make any changes to the default page.tpl.php template. | |||
= Enable & configure the Block = | |||
Now this block will be visible in the blocks disabled area, so from the Dashboard menu go to Structure>Block and enable the block to a themes default region or the custom region we created (featured_slider). (Regions varies depends on the theme you are using.) | |||
Block Configuration Settings | |||
After enabling the block you get a link to configure the block so click on the Configure link and on the settings section set as below; | |||
(1) Block title (if you don't want block title to be displayed just type <none>) | |||
(2) Again you get all enabled theme specific Region settings. | |||
On visibility settings | |||
(3) Pages>Show block on specific page: choose Only the listed pages and type <front> so that this block will be displayed only on the front page. |
Latest revision as of 11:39, 25 March 2014
You can get rid of blocks in
Administer -> structure -> Blocks
If you get rid of the login block, you can login using
http://edgarbv.com/testing/user
Create a Custom Region
(1) On your thems folder open the your_theme_name.info file and add a new region like this shown below;
regions[featured_slider] = Featured Slider
and save the .info file.
(2) Open your themes page.tpl.php file and add these code where you want your slide to be displayed as shown below;
<?php if ($page['featured_slider']): ?> <div id="featured-slider"> <?php print render($page['featured_slider']); ?> </div> <!-- End Featured Slider--> <?php endif; ?>
You can even create custom front page template like page--front.tpl.php so that you do't need to make any changes to the default page.tpl.php template.
Enable & configure the Block
Now this block will be visible in the blocks disabled area, so from the Dashboard menu go to Structure>Block and enable the block to a themes default region or the custom region we created (featured_slider). (Regions varies depends on the theme you are using.)
Block Configuration Settings
After enabling the block you get a link to configure the block so click on the Configure link and on the settings section set as below;
(1) Block title (if you don't want block title to be displayed just type <none>)
(2) Again you get all enabled theme specific Region settings.
On visibility settings
(3) Pages>Show block on specific page: choose Only the listed pages and type <front> so that this block will be displayed only on the front page.