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

 
Drupal WYSIWYG Editor

Thêm tính năng Spellchecker cho Drupal WYSIWYG Editor

Most of us are used to having a spellchecker when we type. If we use Microsoft Word, Google Docs and most other writing tools, you're used to seeing a red line under your spelling mistakes.

Hướng dẫn sử dụng Drupal Aggregator Module

Hướng dẫn sử dụng Drupal Aggregator Module

I blame it on the confusing name. No, Aggregator is not an animal in Florida that eats people. Aggregator is a module that imports content from RSS feeds into Drupal.

Hướng dẫn xóa dữ liệu website trên Google Chrome và Firefox năm 2015

Hướng dẫn xóa dữ liệu website trên Google Chrome và Firefox năm 2015

Xóa bỏ dữ liệu web được lưu trữ trên trình duyệt Google Chrome và Firefox để đảm bảo an toàn cho bạn.

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

 

Diet con trung