<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="http://joetsuihk.com/en/taxonomy/term/23/all" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>theming</title>
    <link>http://joetsuihk.com/en/taxonomy/term/23/all</link>
    <description></description>
    <language>en</language>
     <atom:link href="http://joetsuihk.com/en/taxonomy/term/23/all/feed" rel="self" type="application/rss+xml" />
      <item>
    <title>Drupal 7 theming a node form</title>
    <link>http://joetsuihk.com/en/drupal_7_theming_a_node_form</link>
    <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;我慢慢發現 content type node form 是繼 exposed views form 之後最常要修改的 form&lt;br /&gt;
(我明明有寫過 alter exposed views form, 但找不到...)&lt;/p&gt;
&lt;p&gt;特定 content type 本身是沒有 theme function 的&lt;br /&gt;
先定義一個，順便定義使用一個 tpl 檔輸出&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-taxonomy-vocabulary-2 field-type-taxonomy-term-reference field-label-above&quot;&gt;&lt;div class=&quot;field-label&quot;&gt;Free tags:&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/en/free_tags/development&quot;&gt;Development&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/en/free_tags/theming&quot;&gt;theming&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/en/taxonomy/term/38&quot;&gt;template&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/en/free_tags/drupal7x&quot;&gt;Drupal 7.x&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/en/free_tags/node_form&quot;&gt;node form&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-field-add-this field-type-addthis field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a class=&quot;addthis_button &quot; addthis:title=&quot;Drupal 7 theming a node form - JOE Tsui&amp;#039;s Drupal life in Hong Kong (香港)&quot; addthis:url=&quot;http://joetsuihk.com/en/drupal_7_theming_a_node_form&quot;&gt;&lt;img src=&quot;http://s7.addthis.com/static/btn/sm-share-en.gif&quot; alt=&quot;Share page with AddThis&quot; /&gt;
&lt;/a&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
     <pubDate>Sat, 27 Oct 2012 15:01:18 +0000</pubDate>
 <dc:creator>JOE</dc:creator>
 <guid isPermaLink="false">330 at http://joetsuihk.com</guid>
  </item>
  <item>
    <title>form 也可以使用template (*.tpl.php) (Drupal6.x 版)</title>
    <link>http://joetsuihk.com/en/form_%E4%B9%9F%E5%8F%AF%E4%BB%A5%E4%BD%BF%E7%94%A8template_tplphp_drupal6x_%E7%89%88</link>
    <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;舊文:&lt;br /&gt;&lt;a href=&quot;http://www.joetsuihk.com/form_templates&quot;&gt;http://www.joetsuihk.com/form_templates&lt;/a&gt;&lt;br /&gt;
的做法不太正統, 應該要改成: (用 user-login form 為例):&lt;/p&gt;
&lt;p&gt;theme 的 template.php 之內:&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-taxonomy-vocabulary-2 field-type-taxonomy-term-reference field-label-above&quot;&gt;&lt;div class=&quot;field-label&quot;&gt;Free tags:&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/en/free_tags/theming&quot;&gt;theming&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/en/free_tags/drupal6x&quot;&gt;Drupal 6.x&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/en/free_tags/drupalplanet&quot;&gt;Drupal Planet&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
     <pubDate>Tue, 21 Jun 2011 16:30:03 +0000</pubDate>
 <dc:creator>JOE</dc:creator>
 <guid isPermaLink="false">231 at http://joetsuihk.com</guid>
  </item>
  <item>
    <title>客製輸出 views 的多個值欄位 (theming view field with multiple values)</title>
    <link>http://joetsuihk.com/en/%E5%AE%A2%E8%A3%BD%E8%BC%B8%E5%87%BA_views_%E7%9A%84%E5%A4%9A%E5%80%8B%E5%80%BC%E6%AC%84%E4%BD%8D_theming_view_field_multiple_values</link>
    <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;&lt;a href=&quot;http://drupal.org/project/devel_themer&quot; target=&quot;_blank&quot;&gt;Theme developer&lt;/a&gt; 顯示, theme_content_view_multiple_field() 決定多個值的時候 views 的輸出, &lt;br /&gt;&lt;a href=&quot;http://api.audean.com/api/function/theme_content_view_multiple_field/API+Reference&quot; target=&quot;_blank&quot;&gt;源碼&lt;/a&gt;:&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-taxonomy-vocabulary-2 field-type-taxonomy-term-reference field-label-above&quot;&gt;&lt;div class=&quot;field-label&quot;&gt;Free tags:&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/en/free_tags/theming&quot;&gt;theming&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/en/taxonomy/term/33&quot;&gt;views&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-field-add-this field-type-addthis field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a class=&quot;addthis_button &quot; addthis:title=&quot;客製輸出 views 的多個值欄位 (theming view field with multiple values) - JOE Tsui&amp;#039;s Drupal life in Hong Kong (香港)&quot; addthis:url=&quot;http://joetsuihk.com/en/%E5%AE%A2%E8%A3%BD%E8%BC%B8%E5%87%BA_views_%E7%9A%84%E5%A4%9A%E5%80%8B%E5%80%BC%E6%AC%84%E4%BD%8D_theming_view_field_multiple_values&quot;&gt;&lt;img src=&quot;http://s7.addthis.com/static/btn/sm-share-en.gif&quot; alt=&quot;Share page with AddThis&quot; /&gt;
&lt;/a&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
     <pubDate>Fri, 31 Dec 2010 01:47:35 +0000</pubDate>
 <dc:creator>JOE</dc:creator>
 <guid isPermaLink="false">202 at http://joetsuihk.com</guid>
  </item>
  <item>
    <title>自定Views 欄位輸出 Views fields display</title>
    <link>http://joetsuihk.com/en/%E8%87%AA%E5%AE%9Aviews_%E6%AC%84%E4%BD%8D%E8%BC%B8%E5%87%BA_views_fields_display</link>
    <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;開發多了以後, 慢慢發展了一個自己比較喜歡的 views templating 方式, 分享一下&lt;/p&gt;
&lt;p&gt;1. Row style&lt;br /&gt;
絕大部份 &quot;Row style&quot; 都會使用 &quot;fields&quot;,&lt;br /&gt;
是為了靈活性, 可以在 &quot;Fields&quot; 取需要的欄位&lt;br /&gt;
相反 &quot;Row style&quot; &quot;node&quot; 只可以選擇 &quot;full node&quot; 或者 &quot;teaser&quot;&lt;br /&gt;
而且它的輸出就會使用 node.tpl.php&lt;br /&gt;
不方便, 我習慣自己建立 &quot;frontpage&quot; 資料夾專門用作放置該 views 的 template 的&lt;/p&gt;
&lt;p&gt;2. *.tpl.php 儲存結構&lt;br /&gt;
續上, 一個 views 在該 theme 之內都有一個資料夾&lt;br /&gt;
甚至是一個 display 一個, 例如 views &quot;frontpage&quot;:&lt;br /&gt;
--theme_joe (資料夾)&lt;br /&gt;
----frontpage (資料夾)&lt;br /&gt;
------views-view-fields--frontpage.tpl.php&lt;br /&gt;
----taxonomy (資料夾)&lt;br /&gt;
------views-view-fields--taxonomy.tpl.php&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-taxonomy-vocabulary-2 field-type-taxonomy-term-reference field-label-above&quot;&gt;&lt;div class=&quot;field-label&quot;&gt;Free tags:&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/en/free_tags/theming&quot;&gt;theming&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/en/taxonomy/term/33&quot;&gt;views&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/en/taxonomy/term/38&quot;&gt;template&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/en/free_tags/display&quot;&gt;display&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-field-add-this field-type-addthis field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a class=&quot;addthis_button &quot; addthis:title=&quot;自定Views 欄位輸出 Views fields display - JOE Tsui&amp;#039;s Drupal life in Hong Kong (香港)&quot; addthis:url=&quot;http://joetsuihk.com/en/%E8%87%AA%E5%AE%9Aviews_%E6%AC%84%E4%BD%8D%E8%BC%B8%E5%87%BA_views_fields_display&quot;&gt;&lt;img src=&quot;http://s7.addthis.com/static/btn/sm-share-en.gif&quot; alt=&quot;Share page with AddThis&quot; /&gt;
&lt;/a&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
     <pubDate>Mon, 30 Aug 2010 10:05:00 +0000</pubDate>
 <dc:creator>JOE</dc:creator>
 <guid isPermaLink="false">180 at http://joetsuihk.com</guid>
  </item>
  <item>
    <title>Render Imagecached image through PHP</title>
    <link>http://joetsuihk.com/en/render_imagecached_image_through_php</link>
    <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-taxonomy-vocabulary-2 field-type-taxonomy-term-reference field-label-above&quot;&gt;&lt;div class=&quot;field-label&quot;&gt;Free tags:&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/en/free_tags/development&quot;&gt;Development&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/en/free_tags/theming&quot;&gt;theming&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/en/free_tags/templates&quot;&gt;templates&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/en/free_tags/imagecache&quot;&gt;imagecache&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/en/free_tags/render&quot;&gt;render&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/en/free_tags/imagefield&quot;&gt;imagefield&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
     <pubDate>Tue, 24 Aug 2010 11:20:23 +0000</pubDate>
 <dc:creator>JOE</dc:creator>
 <guid isPermaLink="false">181 at http://joetsuihk.com</guid>
  </item>
  <item>
    <title>views 表格頭 theming (table header theming)</title>
    <link>http://joetsuihk.com/en/views_%E8%A1%A8%E6%A0%BC%E9%A0%AD_theming_table_header_theming</link>
    <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;先修文章:&lt;br /&gt;&lt;a href=&quot;http://joetsuihk.com/node/94&quot;&gt;http://joetsuihk.com/node/94&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://joetsuihk.com/node/95&quot;&gt;http://joetsuihk.com/node/95&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Views 的table header是可以使用 *.tpl.php 修改的,&lt;br /&gt;
常見的應用包括使用 icon 而不使用 text 作為 label&lt;br /&gt;
只要修改 style output 的 views-view-table.tpl.php&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-taxonomy-vocabulary-2 field-type-taxonomy-term-reference field-label-above&quot;&gt;&lt;div class=&quot;field-label&quot;&gt;Free tags:&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/en/free_tags/theming&quot;&gt;theming&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/en/taxonomy/term/33&quot;&gt;views&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/en/free_tags/templates&quot;&gt;templates&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/en/free_tags/drupal6x&quot;&gt;Drupal 6.x&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/en/free_tags/table&quot;&gt;table&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
     <pubDate>Mon, 31 May 2010 14:10:11 +0000</pubDate>
 <dc:creator>JOE</dc:creator>
 <guid isPermaLink="false">169 at http://joetsuihk.com</guid>
  </item>
  <item>
    <title>Drupal7 的 模版改變 Drupal7 theming changes</title>
    <link>http://joetsuihk.com/en/drupal7_%E7%9A%84_%E6%A8%A1%E7%89%88%E6%94%B9%E8%AE%8A_drupal7_theming_changes</link>
    <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;DrupalCon SF 之後, 有很多 video 和session 都放到網上了&lt;br /&gt;
花了幾天的時間看了些自己喜歡的, 例如 &lt;a href=&quot;http://sf2010.drupal.org/conference/sessions/grok-drupal-7-theming&quot; target=&quot;_blank&quot;&gt;A peek at Drupal 7 theme system changes&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;翻譯一下 &lt;a href=&quot;http://www.slideshare.net/pingv/grok-drupal-7-theming&quot;&gt;http://www.slideshare.net/pingv/grok-drupal-7-theming&lt;/a&gt; (不是全部的改變, 詳情參考 ref2)&lt;br /&gt;
1. Drupal 7 theme 需要有以下元素: &lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-taxonomy-vocabulary-2 field-type-taxonomy-term-reference field-label-above&quot;&gt;&lt;div class=&quot;field-label&quot;&gt;Free tags:&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/en/free_tags/theming&quot;&gt;theming&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/en/free_tags/drupal7x&quot;&gt;Drupal 7.x&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/en/free_tags/changelog&quot;&gt;change log&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-field-add-this field-type-addthis field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a class=&quot;addthis_button &quot; addthis:title=&quot;Drupal7 的 模版改變 Drupal7 theming changes - JOE Tsui&amp;#039;s Drupal life in Hong Kong (香港)&quot; addthis:url=&quot;http://joetsuihk.com/en/drupal7_%E7%9A%84_%E6%A8%A1%E7%89%88%E6%94%B9%E8%AE%8A_drupal7_theming_changes&quot;&gt;&lt;img src=&quot;http://s7.addthis.com/static/btn/sm-share-en.gif&quot; alt=&quot;Share page with AddThis&quot; /&gt;
&lt;/a&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
     <pubDate>Mon, 24 May 2010 13:15:03 +0000</pubDate>
 <dc:creator>JOE</dc:creator>
 <guid isPermaLink="false">166 at http://joetsuihk.com</guid>
  </item>
  <item>
    <title>模版的預處理 template preprocess in Drupal 6.x</title>
    <link>http://joetsuihk.com/en/%E6%A8%A1%E7%89%88%E7%9A%84%E9%A0%90%E8%99%95%E7%90%86_template_preprocess_drupal_6x</link>
    <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;繼續 Drupal templates 的深度遊&lt;/p&gt;
&lt;p&gt;Preprocess 是一個在你的theme 之內的 template.php 內的一組函數&lt;br /&gt;
用&quot;一組&quot; 的原因是因為一個theme 是可以有很多 preprocess function&lt;br /&gt;
正確來講, 一個 &lt;a href=&quot;http://www.joetsuihk.com/module_development_introduction_moduleinfo&quot;&gt;hook&lt;/a&gt; 便已經可以有10個 preprocess function (當然, 和 hook 一樣, 不用也是可以的)&lt;/p&gt;
&lt;p&gt;而preprocess 的真正功用是,&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;為 templates 提供更多的變數以供使用&lt;/li&gt;
&lt;li&gt;為hook 提供更多的template suggestion&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;第一點的功能很明顯, 因為 drupal 內建的 preprocess function (無錯, Drupal core 都是使用 preprocess 的)沒法為你的theme 的特殊性供你需要的變數&lt;br /&gt;
你便可以使用preprocess function:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-taxonomy-vocabulary-2 field-type-taxonomy-term-reference field-label-above&quot;&gt;&lt;div class=&quot;field-label&quot;&gt;Free tags:&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/en/free_tags/theming&quot;&gt;theming&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/en/free_tags/preprocess&quot;&gt;preprocess&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/en/free_tags/drupal6x&quot;&gt;Drupal 6.x&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/en/free_tags/templatesuggestion&quot;&gt;template suggestion&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
     <pubDate>Mon, 26 Apr 2010 13:40:02 +0000</pubDate>
 <dc:creator>JOE</dc:creator>
 <guid isPermaLink="false">165 at http://joetsuihk.com</guid>
  </item>
  <item>
    <title>進階 views 模版(二): HTML 列表 Complex views templating, part 2, table, HTML list templates</title>
    <link>http://joetsuihk.com/en/%E9%80%B2%E9%9A%8E_views_%E6%A8%A1%E7%89%88%E4%BA%8C_html_%E5%88%97%E8%A1%A8_complex_views_templating_part_2_table_html_list_templates</link>
    <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;續 &lt;a href=&quot;http://www.joetsuihk.com/complex_views_templating_part_1_intro_config_tpl&quot;&gt;part1&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;補一下 table 顯示之下的 theming.&lt;br /&gt;&lt;img src=&quot;http://www.joetsuihk.com/files/theming-views2-1.png&quot; /&gt;&lt;br /&gt;
假如你的 table 有4個 fields, views 的 theming information 便有6個 templates:&lt;br /&gt;
1個 display 的 tpl (page 或block)&lt;br /&gt;
1個 style tpl, 包含了 &lt;code&gt;&amp;lt;table&amp;gt;&lt;/code&gt;&lt;br /&gt;
每1個 field 都可以有一個自己的 tpl (詳見 attachment)&lt;/p&gt;
&lt;p&gt;HTML list (ul, ol) 也是同樣的情況&lt;br /&gt;
display + style tpl, 外加每個field 一個tpl&lt;br /&gt;
也可以做 field by field 的 tpl, 修改 &lt;code&gt;&amp;lt;ul&amp;gt;&lt;/code&gt; 的class, &lt;code&gt;&amp;lt;li&amp;gt;&lt;/code&gt;多個 span 之類&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-taxonomy-vocabulary-2 field-type-taxonomy-term-reference field-label-above&quot;&gt;&lt;div class=&quot;field-label&quot;&gt;Free tags:&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/en/free_tags/theming&quot;&gt;theming&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/en/taxonomy/term/33&quot;&gt;views&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/en/free_tags/templates&quot;&gt;templates&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/en/free_tags/preprocess&quot;&gt;preprocess&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/en/free_tags/tpl&quot;&gt;tpl&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/en/free_tags/pager&quot;&gt;pager&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
     <pubDate>Mon, 26 Apr 2010 13:39:12 +0000</pubDate>
 <dc:creator>JOE</dc:creator>
 <guid isPermaLink="false">164 at http://joetsuihk.com</guid>
  </item>
  <item>
    <title>Theme-ing &quot;login to post comment&quot;, theme_comment_post_forbidden()</title>
    <link>http://joetsuihk.com/en/themeing_quotlogin_post_commentquot_themecommentpostforbidden</link>
    <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;Recently, i have find some theme-ing functions that cannot be simply find by theme developer module, as that theme function only calls when you are anonymous user.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://api.drupal.org/api/function/theme_comment_post_forbidden/6&quot; target=&quot;_blank&quot;&gt;comment.module theme_comment_post_forbidden()&lt;/a&gt; is an example.&lt;br /&gt;
This function render the &quot;Please login to post comments&quot; to anonymous user, request them to login in order to get access to the comment form.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-taxonomy-vocabulary-2 field-type-taxonomy-term-reference field-label-above&quot;&gt;&lt;div class=&quot;field-label&quot;&gt;Free tags:&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/en/free_tags/theming&quot;&gt;theming&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/en/free_tags/commentmodule&quot;&gt;comment.module&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/en/free_tags/templates&quot;&gt;templates&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-field-add-this field-type-addthis field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a class=&quot;addthis_button &quot; addthis:title=&quot;Theme-ing &amp;amp;quot;login to post comment&amp;amp;quot;, theme_comment_post_forbidden() - JOE Tsui&amp;#039;s Drupal life in Hong Kong (香港)&quot; addthis:url=&quot;http://joetsuihk.com/en/themeing_quotlogin_post_commentquot_themecommentpostforbidden&quot;&gt;&lt;img src=&quot;http://s7.addthis.com/static/btn/sm-share-en.gif&quot; alt=&quot;Share page with AddThis&quot; /&gt;
&lt;/a&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
     <pubDate>Wed, 27 Jan 2010 14:09:40 +0000</pubDate>
 <dc:creator>JOE</dc:creator>
 <guid isPermaLink="false">144 at http://joetsuihk.com</guid>
  </item>
  <item>
    <title>加js, css file 到theme, Add a theme specific js/css to a page</title>
    <link>http://joetsuihk.com/en/node/139</link>
    <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;如題, 你可以在 theme 的 .info file 用以下的方法&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;scripts[] = js/gallery.js&lt;br /&gt;&lt;br /&gt;stylesheets[all][] = css/gallery.css&lt;/code&gt;&lt;/div&gt;&lt;br /&gt;
你可以加第三方的 js/css, 例如 jquery ui, fancybox 之類&lt;br /&gt;
如果你看到你的page.tpl.php 有&lt;code&gt;&amp;lt;script type=&quot;text/javascript&quot; src=&quot;&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;/code&gt;你可能會考慮用以上的方法include 了
&lt;p&gt;Note1: 路徑是相對到theme 的資料夾&lt;br /&gt;
Node2: 它們會&lt;a href=&quot;http://drupal.org/getting-started/6/admin/settings&quot;&gt;被優化&lt;/a&gt;的, 如果你開啟了壓縮 js/css 檔案的話&lt;/p&gt;
&lt;p&gt;As titled, if you want to add a js or css file only to a theme, you may:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-taxonomy-vocabulary-2 field-type-taxonomy-term-reference field-label-above&quot;&gt;&lt;div class=&quot;field-label&quot;&gt;Free tags:&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/en/free_tags/theming&quot;&gt;theming&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/en/taxonomy/term/26&quot;&gt;css&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/en/taxonomy/term/61&quot;&gt;js&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-field-add-this field-type-addthis field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a class=&quot;addthis_button &quot; addthis:title=&quot;加js, css file 到theme, Add a theme specific js/css to a page - JOE Tsui&amp;#039;s Drupal life in Hong Kong (香港)&quot; addthis:url=&quot;http://joetsuihk.com/en/node/139&quot;&gt;&lt;img src=&quot;http://s7.addthis.com/static/btn/sm-share-en.gif&quot; alt=&quot;Share page with AddThis&quot; /&gt;
&lt;/a&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
     <pubDate>Tue, 29 Dec 2009 16:23:00 +0000</pubDate>
 <dc:creator>JOE</dc:creator>
 <guid isPermaLink="false">139 at http://joetsuihk.com</guid>
  </item>
  <item>
    <title>將註冊時連續輸入兩次密碼的表單的字眼改掉</title>
    <link>http://joetsuihk.com/en/node/120</link>
    <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;將註冊時連續輸入兩次密碼的表單的字眼改掉的方法:&lt;/p&gt;
&lt;p&gt;theme 的 template.php 內:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-taxonomy-vocabulary-2 field-type-taxonomy-term-reference field-label-above&quot;&gt;&lt;div class=&quot;field-label&quot;&gt;Free tags:&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/en/free_tags/theming&quot;&gt;theming&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/en/taxonomy/term/29&quot;&gt;Drupal6.x&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/en/taxonomy/term/47&quot;&gt;form&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
     <pubDate>Fri, 20 Feb 2009 17:51:49 +0000</pubDate>
 <dc:creator>JOE</dc:creator>
 <guid isPermaLink="false">120 at http://joetsuihk.com</guid>
  </item>
  <item>
    <title>Drupal6.x 自定form template</title>
    <link>http://joetsuihk.com/en/node/119</link>
    <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;今日重看form template 的組成 :&lt;a href=&quot;http://www.joetsuihk.com/form_templates6&quot;&gt;http://www.joetsuihk.com/form_templates6&lt;/a&gt;&lt;br /&gt;
混亂得我自己都看不明白, 所以重寫&lt;/p&gt;
&lt;p&gt;目的: 重新排位, 令建立新node 的表單簡單點&lt;br /&gt;&lt;img src=&quot;http://www.joetsuihk.com/files/96-1.png&quot; /&gt;&lt;br /&gt;
假設: 要重新排位的 content type 名為 story&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-taxonomy-vocabulary-2 field-type-taxonomy-term-reference field-label-above&quot;&gt;&lt;div class=&quot;field-label&quot;&gt;Free tags:&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/en/free_tags/development&quot;&gt;Development&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/en/free_tags/theming&quot;&gt;theming&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/en/taxonomy/term/29&quot;&gt;Drupal6.x&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
     <pubDate>Sun, 08 Feb 2009 03:40:23 +0000</pubDate>
 <dc:creator>JOE</dc:creator>
 <guid isPermaLink="false">119 at http://joetsuihk.com</guid>
  </item>
  <item>
    <title>Devel block.tpl.php</title>
    <link>http://joetsuihk.com/en/node/111</link>
    <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;&lt;img src=&quot;http://www.joetsuihk.com/files/devel-block.tpl.php.gif&quot; /&gt;&lt;/p&gt;
&lt;p&gt;devel 的 module block,&lt;br /&gt;
作為一個 Drupal 開發者, 是必須將它安放到 sidebar 吧&lt;br /&gt;
但這個 block 有一個很惱人的問題,&lt;br /&gt;
就是, 它太佔位置了&lt;br /&gt;
一整條長長的, 放了在 sidebar 之後&lt;br /&gt;
經常要使用滾動條, 十分不便&lt;/p&gt;
&lt;p&gt;所以, 唯有用 theme 的方式, 將它獨立放到一個下拉式隱藏之內&lt;br /&gt;
省回些位置&lt;br /&gt;
做成了上圖的效果&lt;/p&gt;
&lt;p&gt;製作:&lt;/p&gt;
&lt;p&gt;先用 theme developer, 指向 devel block&lt;br /&gt;
它已經提供了一個最精確, 權限最高的 template 命名: block-menu-devel.tpl.php&lt;/p&gt;
&lt;p&gt;將 theme 內的 block.tpl.php 複製,&lt;br /&gt;
並命名為 block-menu-devel.tpl.php&lt;br /&gt;
修改其內容:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-taxonomy-vocabulary-2 field-type-taxonomy-term-reference field-label-above&quot;&gt;&lt;div class=&quot;field-label&quot;&gt;Free tags:&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/en/free_tags/theming&quot;&gt;theming&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/en/taxonomy/term/29&quot;&gt;Drupal6.x&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/en/taxonomy/term/34&quot;&gt;block&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/en/taxonomy/term/39&quot;&gt;devel&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
     <pubDate>Fri, 12 Sep 2008 15:37:05 +0000</pubDate>
 <dc:creator>JOE</dc:creator>
 <guid isPermaLink="false">111 at http://joetsuihk.com</guid>
  </item>
  <item>
    <title>Theming search form, 搜尋框的模版</title>
    <link>http://joetsuihk.com/en/node/110</link>
    <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;&lt;img src=&quot;http://www.joetsuihk.com/files/theming-search-form.gif&quot; /&gt;&lt;/p&gt;
&lt;p&gt;因為 drupal 原本內建的search form 搜尋框實在太單調的關係,&lt;br /&gt;
修改一下它的外觀, 模版...&lt;/p&gt;
&lt;p&gt;當然, 先打開 search module(今天的主角), devel module, theme developer(開發用主角)&lt;br /&gt;
將search block 放到 sidebar,&lt;br /&gt;
用 theme developer 指一下,&lt;br /&gt;
便知道 search module 已經內建了搜尋框的 template 以供使用, 修改&lt;br /&gt;
search-block-form.tpl.php 是在 block 之內的 template&lt;br /&gt;
search-theme-form.tpl.php 便是其他情況下使用的 template&lt;br /&gt;
可以直接到 [base_path]/module/search 之內&lt;br /&gt;
複製所需的template 到你的 theme 之內&lt;br /&gt;
清空你的 cache 緩存, 你的theme 便會自動使用這個你新增的 template 檔了&lt;/p&gt;
&lt;p&gt;其實一個搜尋框只有三種元素 (element)&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-taxonomy-vocabulary-2 field-type-taxonomy-term-reference field-label-above&quot;&gt;&lt;div class=&quot;field-label&quot;&gt;Free tags:&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/en/free_tags/theming&quot;&gt;theming&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/en/taxonomy/term/29&quot;&gt;Drupal6.x&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/en/taxonomy/term/37&quot;&gt;search form&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/en/taxonomy/term/38&quot;&gt;template&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-field-add-this field-type-addthis field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a class=&quot;addthis_button &quot; addthis:title=&quot;Theming search form, 搜尋框的模版 - JOE Tsui&amp;#039;s Drupal life in Hong Kong (香港)&quot; addthis:url=&quot;http://joetsuihk.com/en/node/110&quot;&gt;&lt;img src=&quot;http://s7.addthis.com/static/btn/sm-share-en.gif&quot; alt=&quot;Share page with AddThis&quot; /&gt;
&lt;/a&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
     <pubDate>Sun, 07 Sep 2008 09:12:05 +0000</pubDate>
 <dc:creator>JOE</dc:creator>
 <guid isPermaLink="false">110 at http://joetsuihk.com</guid>
  </item>
  </channel>
</rss>
