Create if logic with fields My task is to create a field that is visible to the author node.

Let's say the content type is "article" and the field is "textid" that contains the node ID number.

I've already created it with Display suite as a custom field with token [node:nid], so the result is some text with number of the node ID.

How can I make that field visible only by the node author?

What hook should I use?
You can simply use Field Permissions module:


  Author-level permissions allow viewing and editing of fields based on who the entity owner 
  is.


This seems to be exactly what you need.

To have real field (not display suite element), you can use Computed Field - more complicated than Display Suite, true, but at the same time more versatile and integrates well with everything field-related.

On the other hand, you can forget all these modules, and in your node.tpl.php simply compare current user id with node author's id, and if they are equal, print your data.