Create a Custom Block

At this stage, the site is coming together and getting close to final form. The open issue on the client's wish list was for button ads. For this one, given the budget, he's getting the low tech solution; I'm going to create a new block and code the image placement and URL link directly into the block.

Go to the Blocks Manager and choose Add Block. Type a descriptive name for the Block title and then use HTML to specify the image and the URL that it links to.

We also need to set the visibility for our new block. Under the heading User specific visibility settings, choose Users cannot control whether or not they see this block. Under the heading Page specific visibility settings, choose the first option, Show on every page except the listed pages. Then input into the Pages text box on one line admin and on another line admin/*. The first command bans the block from the main admin page; the second bans the block from any of the interior admin pages.

Home > Administer * Site building > Blocks

Blocks List |

Use this page to create a new custom block. New blocks are disabled by default, and must be moved to a region on the blocks administration page to be visible.

u Block specific settings

Block description; *_

|holds graphical button ads

A brief description of your block. Used on the block overview page. Block title: |Button Ads

The title of the block as shown to the user. Block body:

<a href="#" target="_blank"><i.mg src="sites/defauIt/files/button-ad-1 .gif border="0" ait="gear heads" </a>

The content of the block as shown to the user, v Input format r Filtered HTML

O Web page addresses and e-mail addresses turn into links automatically. O Allowed html tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> O Lines and paragraphs break automatically.

& Full HTML

O Web page addresses and e-mail addresses turn into links automatically. O Lines and paragraphs break automatically.

c PHP code

O You may post PHP code. You should include <?php ?> tags.

More information about formatting options u User specific visibility settings Custom visibility settings:

^ Users cannot control whether or not they see this block. <** Show this block by default, but let individual users hide it. ^ Hide this block by default but let individual users show it. Allow Individual users to customize the visibility of this block In their account settings.

sj Role specific visibility settings Show block for specific roles:

V anonymous user

V authenticated user

Show this block only for the selected role(s). If you select no roles, the block will be visible to all users, v Page specific visibility settings

Show block on specific pages:

Show on every page except the listed pages. C Show on only the listed pages.

f Show if the following PHP code returns true (PHP-mode, experts only).

Pages:_

admin admin/*!

Enter one page per line as Drupal paths. The '*' character Is a wildcard. Example paths are blog for the blog page and blog/* for every personal blog. <fiw?t> Is the front page. If the PHP-mode Is chosen, enter PHP code between <?php •*>. Note that executing Incorrect php-code can break your Drupal site.

Save block |

Adding a new (very simple!) custom block to hold the client's button ad image. Note the Input format option is set to Full HTML in the example, in order to give more flexibility in use of code in the block body.

Finally, let's go the blocks manager and assign this new block to the Right Sidebar region, as the two side columns still look a bit unbalanced in our layout.

0 0

Post a comment