I am racking my brain trying to figure out how to create a conditional statement in Drupal concerning the "Authored By" field.

Right now, I have a special node template for a content type in my Drupal installation. I need to be able to define in that template when the "Authored By" field is filled in to display JUST the author full name but if it is not filled in, to display NOTHING.

I don't know I am having such a hard time accomplishing something so seemingly elementary, but any help would be greatly appreciated!

1 Answer 1


I believe the default variable for the author is $name. So you could perform a simple if statement in the template:

if (isset ($name)) {
print $name;

That will check if the $name variable is set - and if it is, print it out. If it's not set, nothing will happen.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.