开发者

drupal show/hide certain fields based on author

I would like to show / hide certain fields in my Drupal view based on whether the current user is the author of the node being viewed.

I installed the Views Custom Field module which seems to allow this, but I have no knowledge of PHP,开发者_StackOverflow社区 so wondered if anyone could help me with the PHP code.


Something like this (check that $data has uid, maybe different name):

global $user;
if ($user->uid == $data->uid) {
  print 'something';
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜