การสร้าง Regions เพิ่มใน Drupal 6

สำหรับ Drupal 6.x ง่ายมาก …
ให้เพิ่มใน .info ของธีม เช่น

regions[left] = Left sidebar
regions[right] = Right sidebar
regions[content] = Content
regions[header] = Header
regions[footer] = Footer
regions[newblock1] = newblock1
regions[newblock2] = newblock2
regions[newblock3] = newblock3

แล้วไป print ใน page.tpl.php โดยใช้ชื่อที่ตั้งไว้เป็นชื่อตัวแปร เช่น
[code lang="php"]< ?php print $newblock1 ?>[/code]

แค่นี้ก็ใช้ได้แล้ว แต่ ?
** ยังมีอีกนิด **
คือว่าเนื้อหาใน .info มันจะถูก cached เอาไว้
ดังนั้นเราต้องไป clear cached ซะก่อน (ที่หน้า admin/settings/performance)

เพิ่มเติม: http://drupal.org/node/171224

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>