ข้ามไปยังเนื้อหาหลัก
หน้าแรก
DrupalThailand

Main navigation

  • หน้าแรก
  • ฟอรั่ม
  • ประกาศงาน
  • บทความ
  • กิจกรรม
User account menu
  • เข้าสู่ระบบ

การแสดงเส้นทาง

  1. หน้าแรก

drupal

By admin, 7 สิงหาคม, 2021

เพิ่ม class body tag ตาม path เว็บไซต์

แก้ไขที่  .theme ใน folder Theme ของคุณ  แล้ว โค้ดที่ได้จากข้างล่างนี้  
(THEMENAME  เปลี่ยนเป็นชื่อ Theme ของคุณเอง)

/**
 * Implements hook_preprocess_html().
 */
function THEMENAME_preprocess_html(&$vars) {
  // Get the current path
  $current_path = \Drupal::service('path.current')->getPath();
  $internal = \Drupal::service('path_alias.manager')->getAliasByPath($current_path);

  // Assign it to body class 
  $vars['attributes']['class'][] = str_replace("/", "", $internal);
}
  • อ่านต่อ เกี่ยวกับ เพิ่ม class body tag ตาม path เว็บไซต์
  • Log in or register to post comments
By admin, 5 สิงหาคม, 2021

Drupal 8 Entity API cheat sheet (Part 2)

การทำงานกับ ไฟล์  (File entities)

วิธีส่งค่าไฟล์ออกมาด้วย fid ใน Drupal:

$fid = 31;      // ตัวอย่าง fid
$file_storage = \Drupal::entityTypeManager()->getStorage('file');
$file = $file_storage->load($fid);

การแสดงค่า ออกจากตัวแปร

  • อ่านต่อ เกี่ยวกับ Drupal 8 Entity API cheat sheet (Part 2)
  • Log in or register to post comments
By admin, 11 พฤษภาคม, 2021

Drupal 8 Entity API cheat sheet (Part 1)

Drupal 8 Entity API cheat sheet

การทำงานเกี่ยวกับ nodes

โหลด Node โดย nid:

$nid = 123;  // ตัวอย่าง nid 
$node_storage = \Drupal::entityTypeManager()->getStorage('node');
$node = $node_storage->load($nid);

Get ค่า nid:

echo $node->id();  // 123

Get ค่า bundle type (หรือ content type):

  • อ่านต่อ เกี่ยวกับ Drupal 8 Entity API cheat sheet (Part 1)
  • Log in or register to post comments
By admin, 18 มกราคม, 2017

อินเตอร์เน็ตในทุกสิ่ง Internet of Things (ioT)

Internet-Of-Things (IoT)

เทคโนโลยี Internet of Things (ioT) หรือ “อินเตอร์เน็ตในทุกสิ่ง” หมายถึง การที่สิ่งต่างๆ ถูก เชื่อมโยงทุกสิ่งทุกอย่างเข้าสู่โลกอินเทอร์เน็ต ที่ทำให้มนุษย์สามารถสั่งการ ควบคุมใช้งานอุปกรณ์ต่างๆ ผ่านทางเครือข่ายอินเตอร์เน็ต เช่น การสั่งเปิด-ปิด อุปกรณ์เครื่องใช้ไฟฟ้า รถยนต์ โทรศัพท์มือถือ เครื่องมือ สื่อสาร เครื่องมือทางการเกษตร เครื่องจักรในโรงงานอุตสาหกรรม อาคาร บ้านเรือน และเครื่องใช้ในชีวิตประจำวันต่างๆ ผ่านเครือข่ายอินเทอร์เน็ต เป็นต้น โดยเทคโนโลยีนี้จะเป็ นทั้งประโยชน์อย่าง มหาศาล และความเสี่ยงไปพร้อมๆ กัน เพราะหากระบบรักษาความปลอดภัยของอุปกรณ์และเครือข่

  • อ่านต่อ เกี่ยวกับ อินเตอร์เน็ตในทุกสิ่ง Internet of Things (ioT)
drupal

Tags

  • siteaudit
  • ฟรี
  • iot
  • drupal8
  • drupal
Powered by Drupal Thailand