Think Of Blocks As Containers For Content
Blocks are one of my favorite Drupal features. Here's what I like about Drupal blocks.
- You can use blocks as a very simple way to customize the look of your site.
- Blocks can contain lists of posts, widgets or even custom php code snippets.
- Certain themes, like Artists C01, and modules, like panels, allow great control over the display of content.
- You have a great amount of control over who sees a block and where they are placed.
There are several ways that you can put more blocks into action on your site.
- Many modules will add special blocks to your site. For example, the image module adds a random image block which I'm using on this site. When you install a new module check to see if it has added any blocks that you can use.
- You can create your own blocks by adding text, HTML (or even PHP) code. Just got to admin/build/block/add on your Drupal site. You can do just about anything you want here. You can display images or add widgets like Flash video players and image slideshows.
- More advanced site builders can utilize the views module to create dynamic blocks from content on their site.
I like to think of blocks in Drupal as flexible containers for content. Blocks don't have to be located in the sidebar. Blocks don't have to be visible by all users (see Show block for specific roles:). Blocks can be located on any page you want (see Show block on specific pages:).
Here's an important tip for those of you who want to add your own content to a block. Double check the input format for your block. Embedded javascript widgets and images require that you choose the Full HTML input format in order to display the content properly.
So if you haven't worked with blocks too much yet I recommend that you spend some time becoming familiar with this very excellent feature of the Drupal platform.
- learnbythedrop's blog
- 2201 reads


Comments
Hyperlink in a block
Hi Robb,
How can I make the title of a block a hyperlink ? I've investigated drupal.org and the administration section of my Getting started site but couldn't find anything I understood...Thank you in advance
Linking Block Title
How you would do it would probably depend on how the block was created. For example, you could create a block by entering text and html at /admin/build/block/add. If you leave the "Block title" field blank then you could set up the first line of the "Block body" as the linked title and then add the rest of the content below.
If the block data is generated by a view or another module you might be able to do it by altering the block theme. How to Make a Block Title Link on Drupal.org seems to provide some good information on how to do that.
Got it
I'd better take baby steps and learn html first! Sorry for this naive question...Thanks for your time
Rich Text Editors
If you add a rich text editor to your site (WYSIWYG API module is very helpful) you won't need to know much html.
Add a block or region in the top right corner
Hello Robb,
I have been searching the web for a solution to a question that I have.
I intend to have my login panel placed in the top right corner of the page. To achieve that, I created a custom block and now I don't know how to place where I want it to be.
I am using pixture reloaded theme on my site.
Thanks in advance for your kind answer.
Locating Blocks
When you're on the blocks administration page the theme should displays the different locations where you can place a block for that theme. I believe that it's pretty unusual that you would locate a block in the top corner of the page. I assume that you're talking about the top corner above the header.
You may want to use the corner module (http://drupal.org/project/corner), which allows you to place an image link in the top corner, to create a link to the login page.
Post new comment