<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="http://joetsuihk.com/en/taxonomy/term/163/all" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>hierarchy select</title>
    <link>http://joetsuihk.com/en/taxonomy/term/163/all</link>
    <description></description>
    <language>en</language>
     <atom:link href="http://joetsuihk.com/en/taxonomy/term/163/all/feed" rel="self" type="application/rss+xml" />
      <item>
    <title>解決樹狀分類層級不明的問題 solving the unknown level of taxonomy trees</title>
    <link>http://joetsuihk.com/en/%E8%A7%A3%E6%B1%BA%E6%A8%B9%E7%8B%80%E5%88%86%E9%A1%9E%E5%B1%A4%E7%B4%9A%E4%B8%8D%E6%98%8E%E7%9A%84%E5%95%8F%E9%A1%8C_solving_unknown_level_taxonomy_trees</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;Taxonomy 分類是可以多層的, 樹狀的&lt;br /&gt;
但有一個很大的問題, 就是 taxonomy_get_term(), node_load() 的時候的分類並沒有有關層的參數&lt;br /&gt;
即是, 雖然分類有層級, 但我並不知道這個分類是最頂層, 中間, 還是最底&lt;br /&gt;
這個問題一直很困擾, 因為像以下的例子:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;China&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;Beijing&lt;/li&gt;
&lt;li&gt;Shanghai&lt;/li&gt;
&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;就不能輕易找出&quot;城巿&quot;了&lt;/p&gt;
&lt;p&gt;最近找到一個比較可行的方法&lt;br /&gt;
1. hierarchical_select&lt;br /&gt;
一個方便的功能, 能令你的層級選擇的時候更人性化&lt;br /&gt;
我使用的設定是將每一層的分類都儲存, 而不是只是儲存末諯分類&lt;/p&gt;
&lt;p&gt;2. content taxonomy&lt;br /&gt;
不使用原生的 分類連到 content type&lt;br /&gt;
而使用 cck 將 taxonomy 到 content type&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/drupal&quot;&gt;Drupal&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/en/taxonomy/term/32&quot;&gt;taxonomy&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/en/taxonomy/term/35&quot;&gt;cck&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/en/free_tags/computedfield&quot;&gt;Computed field&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/en/free_tags/hierarchyselect&quot;&gt;hierarchy select&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/en/free_tags/tree&quot;&gt;tree&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;解決樹狀分類層級不明的問題 solving the unknown level of taxonomy trees - JOE Tsui&amp;#039;s Drupal life in Hong Kong (香港)&quot; addthis:url=&quot;http://joetsuihk.com/en/%E8%A7%A3%E6%B1%BA%E6%A8%B9%E7%8B%80%E5%88%86%E9%A1%9E%E5%B1%A4%E7%B4%9A%E4%B8%8D%E6%98%8E%E7%9A%84%E5%95%8F%E9%A1%8C_solving_unknown_level_taxonomy_trees&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, 31 Jan 2011 13:31:28 +0000</pubDate>
 <dc:creator>JOE</dc:creator>
 <guid isPermaLink="false">204 at http://joetsuihk.com</guid>
  </item>
  </channel>
</rss>
