Đặt Drupal Block vào bên trong một node

Đặt Drupal Block vào bên trong một node

This tutorial will show you how to take a block and place it inside a Drupal node.

Often this is done through one of two methods:

  1. With modules such as Panels or Context which allows you to easily place blocks and many other Drupal items inside nodes.
  2. With PHP code snippets.

However, sometimes Panels and PHP are too complex and you need a quicker and easier solution. Enter the "Insert Block" module. Here's how to use it:

Install and Configure Insert Block

tutuploadsmedia_1291058179234.png

Go to http://drupal.org/project/insert_block and download the Insert Block module. Upload it to your site and enable it.

tutuploadsmedia_1291058217784.png

Go to Site configuration >> Input formats and click on Configure next to the input format that you're using.

tutuploadsmedia_1291058263646.png

Scroll to the bottom of the page and check the box next to "insert block filter". This will allow you to use the Insert Block feature with this particular input format.

Get the Block Information

tutuploadsmedia_1291056468826.png

Go to Site building >> Blocks. We're going to get the information we need to insert each module.

Click on "configure" next to the module you want to insert in a node.

tutuploadsmedia_1291056673910.png

Look at the URL of the page. You need to note the last two parts of the URL. In the case above for the "Navigation" block, it's /user/1/

For the "Who's online" block below it's /user/3/ and for the "Primary links" block it's /menu/primary-links/

tutuploadsmedia_1291056516269.png

tutuploadsmedia_1291058422652.png

Place Blocks in Your Node

tutuploadsmedia_1291058705935.png

Open up the node that you want to put blocks into and use this syntax:

[block:user=1] (this will place the Navigation block)

[block:user=3] (this will place the Who's online block)

[block:menu=primary-links] (this will place the Primary links block)

tutuploadsmedia_1291058779500.png

Save the node and your blocks should appear inside the content as they do above.

Bạn thấy bài viết này như thế nào?: 
Average: 5 (1 vote)
Ả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

 
SEO

SEO chân trang liệu có tác dụng không?

GoDaddy được biết đến như một nhà cung cấp hosting và domain lớn nhất thế giới. Năm 2010, chỉ riêng mảng domain đã mang lại khoảng 1 tỉ USD tiền mặt và hơn 50/90 triệu domain trên thế giới đang là khách hàng của GoDaddy.

Điện thoại LG dòng L đã bán được 15 triệu chiếc

Điện thoại LG dòng L đã bán được 15 triệu chiếc

Hãng điện tử đến từ Hàn Quốc là LG vừa cho biết các sản phẩm thuộc dòng L, bao gồm L3, L5, L7, L9 đã chạm mốc 15 triệu chiếc được bán ra trên toàn cầu.

Trứng Phục Sinh Ngay Trên Nút “I’m Feeling Lucky”

Trứng Phục Sinh Ngay Trên Nút “I’m Feeling Lucky”

Nhưng không phải ai cũng biết rằng Google đã giấu một quả trứng Phục sinh vào nút bấm tưởng chừng bỏ đi đó.

 

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

 

Diet con trung