ปัญหาการอัพไฟล์
ถ้าใช้ โมดูล jquery_update 7.x.27 ให้อัพเดทไปเป็น 7.x-3.0-alpha5
แล้วเปลี่ยนใช้ jquery version 1.12 หรือ 2.1 สำหรับ admin theme
ปัญหาการอัพไฟล์
ถ้าใช้ โมดูล jquery_update 7.x.27 ให้อัพเดทไปเป็น 7.x-3.0-alpha5
แล้วเปลี่ยนใช้ jquery version 1.12 หรือ 2.1 สำหรับ admin theme
Drupal 7
if (module_exists('blog')) {
echo 'blog module is enabled';
}
Drupal 8
\Drupal::moduleHandler()->moduleExists($module);
Drupal 7
เราใช้ ฟังชั่น taxonomy_term_load()
สำหรับ tid ตัวเดียว
<?php
$term = taxonomy_term_load($tid);
$name = $term->name;
?>
สำหรับ หรับ tid หลายตัว
<?php
$tids = array(1, 2, 3);
$terms = taxonomy_term_load_multiple($tids);
foreach ($terms as $term) {
$name = $term->name;
}
?>
Drupal 6 and 7
drush cc
drush sql-dump > ~/my-sql-dump-file-name.sql
drush sql-dump --gzip --result-file=backupdbsite.sql
Drupal 8
แสดงเนื้อหาแค่ 1 node เท่านั้น
$nid = '11';
$content_id = entity_load_single('node', $nid);
$content = entity_view('node', [$content_id], 'full');
print $content;