Thêm 1 vị trí Drupal Block với ShallowGrunge.Module

Thêm 1 vị trí Drupal Block với ShallowGrunge.Module

We're going to be adding a block position to a Drupal 6 theme called ShallowGrunge: http://drupal.org/project/shallowgrunge

The Goal

tutuploadsmedia_1273256567138.png

One of our students wanted to put a block position inside the red header bar. If you haven't done so already, download and install ShallowGrunge: http://drupal.org/project/shallowgrunge

The Current Blocks

tutuploadsmedia_1273256707673.png

Currently there is only a "content" and a "right sidebar" region.

Finding Where to Insert

tutuploadsmedia_1273257642831.png

I'm using the WebDeveloper toolbar for Firefox to help me identify the red header bar's area. I click on CSS >> View Style Information and then click on the area. The toolbar tells me that the area is called #menu

Opening the Files

Adding a New Drupal Block Position

In your site files, navigate to sites / all / themes / shallowgrunge / shallowgrunge.info and open that file

Add the Region Name

tutuploadsmedia_1273257117855.png

This file contains all the information Drupal needs to know about the theme. Now we're going to tell it about our new region. Currently only two regions are defined in this file. You'll need to add another using this line: regions[header] = Header

Open page.tpl.php

tutuploadsmedia_1273257231150.png

The file that controls the layout of our theme is page.tpl.php so let's open that up.

Add the Region Code

tutuploadsmedia_1273257391775.png

We scroll down in the file until we find the div called "menu" and we can insert our block code into there. The syntax is:

1.<?php print $header>

Check Your New Region

tutuploadsmedia_1273257562262.png

Check back in Administer >> Site building >> Blocks and your new "header" region should show.

 

Bạn thấy bài viết này như thế nào?: 
No votes yet
Ảnh của Tommy Tran

Tommy owner Express Magazine

Drupal Developer having 9+ year experience, implementation and having strong knowledge of technical specifications, workflow development. Ability to perform effectively and efficiently in team and individually. Always enthusiastic and interseted to study new technologies

  • Skype ID: tthanhthuy

Tìm kiếm bất động sản

 

Advertisement

 

jobsora

Dich vu khu trung tphcm

Dich vu diet chuot tphcm

Dich vu diet con trung

Quảng Cáo Bài Viết

 
Hướng dẫn tạo 1 userr mới - SSH user on Centos

Hướng dẫn tạo 1 userr mới - SSH user on Centos

You can also grant root permissions to this username by using sudo for all commands:

Sau Messenger Platform liệu có Facebook OS

Sự kiện Facebook F8 diễn ra rạng sáng nay diễn ra không kèn không trống nhưng khiến những gã khủng lồ phải run sợ.

Cài đặt hook_flag_access for controlling what the user can flag Drupal

Cài đặt hook_flag_access for controlling what the user can flag Drupal

Recently, a client wanted their site users to be able to show their support for certain content nodes in Drupal. This can be done very nicely with the flag module. In case you missed it, flag module is a very useful module that has many applications - such as flag as offensive, like, friend, etc.

Công ty diệt chuột T&C

 

Diet con trung