Appreciate, respect and accept it, don't take it for granted
2016-06-16
客製化Drupal原生下拉式選單
2016-04-28
No Access-Control-Allow-Origin header is present on the requested resource
  • 問題描述
  • 本質
  • 解法
2016-03-31
Get field names of Content Type in Drupal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38

/**
* 取得ContentType的field name
* @see
* @link http://drupal.stackexchange.com/questions/39850/get-all-fields-for-a-given-content-type-including-title
*/

function modulename_get_field_name($content_type){

$fields = array();
$field_map = field_info_field_map();
$instances = field_info_instances('node', $content_type);
$extra_fields = field_info_extra_fields('node', $content_type, 'form');

// Fields.
foreach ($instances as $name => $instance) {
$field = field_info_field($instance['field_name']);
$fields[$instance['field_name']] = array(
'field_name' => $instance['field_name'],
'title' => $instance['label'],
'weight' => $instance['widget']['weight'],
'type' => $field_map[$instance['field_name']]['type'],
);
}


// Non-field elements. ex. title
foreach ($extra_fields as $name => $extra_field) {
$fields[$name] = array(
'title' => $extra_field['label'],
'weight' => $extra_field['weight'],
);
}

return $fields;
}


2016-03-31
Drupal Development Resources
  • Concepts
  • Tools
  • Nice Modules and API
  • Code Snippet
2016-03-28
Batch API Notes
  • 設定operations
  • 設定batch資訊
  • 設定finish callback function
  • 線上展示
  • 其他批次處理可用模組
2016-03-28
How to access data in Drupal 7
  • Basic API
  • Database API
    • Dynamic Query
    • Static Query
    • Show Query String and Arguments
  • EntityFieldQuery
2016-03-02
Config Static IP in Ubuntu
  • 設定network interface
  • 重新讀取網路設定
2016-03-02
Check Hardware Information in Ubuntu
  • CPU
  • RAM
  • HD
  • MAC Adress
2016-02-19
Notes for Vim
  • 概念Concept
  • 基本Basic
  • 組合技Combo
2016-02-18
Github Pages with Octopress
  • 建置Octopress
  • 設定佈署到 github
  • 網站設定
  • 內容管理