2014-09-24 31 views

回答

0

實現此目的的一種方法是啓用php過濾器並在特定頁面上設置 顯示區塊 - >此代碼在塊設置中返回TRUE(僅限專家) 的頁面。

,那麼你可以訪問登錄的用戶的用戶配置文件字段而言這樣

global $user; 
$user = user_load($user->uid); 

$term1 = $user->field_term1[LANGUAGE_NONE][0]['value']; //the value should be the tid of the term 
$term2 = $user->field_term2[LANGUAGE_NONE][0]['value']; 

,那麼你可以返回相應的真正的控制塊的可見性。

例如

 return $term1 == 15 //this is the tid of the term 

上面的代碼將顯示該塊只與TID自定義字段項用戶= 15

希望我不會混淆你。

相關問題