<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="http://joetsuihk.com/zh-hant/taxonomy/term/101/all" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>advanced</title>
    <link>http://joetsuihk.com/zh-hant/taxonomy/term/101/all</link>
    <description></description>
    <language>zh-hant</language>
     <atom:link href="http://joetsuihk.com/zh-hant/taxonomy/term/101/all/feed" rel="self" type="application/rss+xml" />
      <item>
    <title>建立一個自定義的區塊模組, 管理複雜的內容和權限設定 custom block module for complex block content and visability </title>
    <link>http://joetsuihk.com/zh-hant/%E5%BB%BA%E7%AB%8B%E4%B8%80%E5%80%8B%E8%87%AA%E5%AE%9A%E7%BE%A9%E7%9A%84%E5%8D%80%E5%A1%8A%E6%A8%A1%E7%B5%84_%E7%AE%A1%E7%90%86%E8%A4%87%E9%9B%9C%E7%9A%84%E5%85%A7%E5%AE%B9%E5%92%8C%E6%AC%8A%E9%99%90%E8%A8%AD%E5%AE%9A_custom_block_module_complex_block_content_and_visability</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;1. 返回NULL 便可以令系統跳過&lt;br /&gt;
很方便的就可以處理不顯示的狀態&lt;br /&gt;
先檢查顯示與否, 不顯示或權限不足便返回 NULL&lt;/p&gt;
&lt;p&gt;2. 源碼管理軟件 (scm) 可以助管理&lt;br /&gt;
傳統的 add block 方法將block 內容和顯示的邏輯放到資料庫&lt;br /&gt;
不利於 scm 管理&lt;br /&gt;
而且使用文件的方式儲存代碼更加有更新容易, 除錯容易等等的優點&lt;br /&gt;
身為開發者, 而不是使用者, 有責任為網站提供一個更容易維護的環境&lt;/p&gt;
&lt;p&gt;3. 避免將錯誤的PHP 放到資料庫&lt;br /&gt;
在顯示設定很多時候都會用到 PHP code&lt;br /&gt;
而錯誤的 syntax error 的 PHP code 放到資料庫,&lt;br /&gt;
會為頁面不能顯示, 也不可以使用 web 介面修改&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;/zh-hant/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;/zh-hant/taxonomy/term/34&quot;&gt;block&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/zh-hant/free_tags/module_development&quot;&gt;module development&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/zh-hant/free_tags/hookblock&quot;&gt;hook_block&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/zh-hant/free_tags/advanced&quot;&gt;advanced&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
     <pubDate>Mon, 11 Oct 2010 12:53:58 +0000</pubDate>
 <dc:creator>JOE</dc:creator>
 <guid isPermaLink="false">188 at http://joetsuihk.com</guid>
  </item>
  <item>
    <title>進階 views 模版(一): 簡介, 設定, tpl 檔 Complex views templating, part 1, intro, config, tpl</title>
    <link>http://joetsuihk.com/zh-hant/%E9%80%B2%E9%9A%8E_views_%E6%A8%A1%E7%89%88%E4%B8%80_%E7%B0%A1%E4%BB%8B_%E8%A8%AD%E5%AE%9A_tpl_%E6%AA%94_complex_views_templating_part_1_intro_config_tpl</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 的 theming/templating 是Drupal theming 的高級班了&lt;br /&gt;
之前一直沒有信心將這個部份的教做好, 但這次都要挑戰一下難度, 唯有試試用多一點圖片展示了&lt;/p&gt;
&lt;p&gt;首先, 我們常用的theme developer 是不能夠幫我們查出 tpl 的檔名的 (但仍可以看到可用的 vars)&lt;br /&gt;
因為 views 的 templating 機制雖和 Drupal core 的極相似, 但卻是views 自己定義的&lt;br /&gt;
主要是為了應付更複雜, 更多變的情況&lt;br /&gt;
但也不需要擔心, 概念上, 操作上都和我們一向做的非常相似&lt;/p&gt;
&lt;p&gt;既然theme developer 不適用, views 有自己的 tpl suggestion: Basic settings 內的 Theme: information(下圖1)&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;http://www.joetsuihk.com/files/views-theming1_0.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;上圖二便是 tpl suggestions, 而粗體則是現正在使用的 tpl 檔&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;/zh-hant/taxonomy/term/33&quot;&gt;views&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/zh-hant/taxonomy/term/38&quot;&gt;template&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/zh-hant/free_tags/advanced&quot;&gt;advanced&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
     <pubDate>Tue, 20 Apr 2010 12:12:17 +0000</pubDate>
 <dc:creator>JOE</dc:creator>
 <guid isPermaLink="false">160 at http://joetsuihk.com</guid>
  </item>
  </channel>
</rss>
