Skip to main content

A node has a uid field. In a node view iI would like to add a field to show the author name with his pictures. I now added a field and using entity referecingreferencing to a view with all users where I can select the user of the node, and displaying the entity as a useraccount has the desired result. But now I need to select the author so that's very bad, i could update the field using node_update hook but this is so ugly i'mI'm out looking for a way how this should be done. So basiclybasically I need to display fields form the node owner on the node as a field..

Thx for insights !

Came up with a different approach created code fields with display suite and used this for the userimage for example, works fine and no extra modules needed using this method.

uid); print theme('user_picture', array('account' =>$user)); }
<?php
if ($node = menu_get_object()) {
  $user = user_load($node->uid);
  print theme('user_picture', array('account' =>$user));
}

A node has a uid field. In a node view i would like to add a field to show the author name with his pictures. I now added a field and using entity referecing to a view with all users where I can select the user of the node, and displaying the entity as a useraccount has the desired result. But now I need to select the author so that's very bad, i could update the field using node_update hook but this is so ugly i'm out looking for a way how this should be done. So basicly I need to display fields form the node owner on the node as a field..

Thx for insights !

Came up with a different approach created code fields with display suite and used this for the userimage for example, works fine and no extra modules needed using this method.

uid); print theme('user_picture', array('account' =>$user)); }

A node has a uid field. In a node view I would like to add a field to show the author name with his pictures. I now added a field and using entity referencing to a view with all users where I can select the user of the node, and displaying the entity as a useraccount has the desired result. But now I need to select the author so that's very bad, i could update the field using node_update hook but this is so ugly I'm out looking for a way how this should be done. So basically I need to display fields form the node owner on the node as a field.

Came up with a different approach created code fields with display suite and used this for the userimage for example, works fine and no extra modules needed using this method.

<?php
if ($node = menu_get_object()) {
  $user = user_load($node->uid);
  print theme('user_picture', array('account' =>$user));
}
found an answer
Source Link
byenary
  • 149
  • 4

A node has a uid field. In a node view i would like to add a field to show the author name with his pictures. I now added a field and using entity referecing to a view with all users where I can select the user of the node, and displaying the entity as a useraccount has the desired result. But now I need to select the author so that's very bad, i could update the field using node_update hook but this is so ugly i'm out looking for a way how this should be done. So basicly I need to display fields form the node owner on the node as a field..

Thx for insights !

Came up with a different approach created code fields with display suite and used this for the userimage for example, works fine and no extra modules needed using this method.

uid); print theme('user_picture', array('account' =>$user)); }

A node has a uid field. In a node view i would like to add a field to show the author name with his pictures. I now added a field and using entity referecing to a view with all users where I can select the user of the node, and displaying the entity as a useraccount has the desired result. But now I need to select the author so that's very bad, i could update the field using node_update hook but this is so ugly i'm out looking for a way how this should be done. So basicly I need to display fields form the node owner on the node as a field..

Thx for insights !

A node has a uid field. In a node view i would like to add a field to show the author name with his pictures. I now added a field and using entity referecing to a view with all users where I can select the user of the node, and displaying the entity as a useraccount has the desired result. But now I need to select the author so that's very bad, i could update the field using node_update hook but this is so ugly i'm out looking for a way how this should be done. So basicly I need to display fields form the node owner on the node as a field..

Thx for insights !

Came up with a different approach created code fields with display suite and used this for the userimage for example, works fine and no extra modules needed using this method.

uid); print theme('user_picture', array('account' =>$user)); }
Source Link
byenary
  • 149
  • 4

display node owner

A node has a uid field. In a node view i would like to add a field to show the author name with his pictures. I now added a field and using entity referecing to a view with all users where I can select the user of the node, and displaying the entity as a useraccount has the desired result. But now I need to select the author so that's very bad, i could update the field using node_update hook but this is so ugly i'm out looking for a way how this should be done. So basicly I need to display fields form the node owner on the node as a field..

Thx for insights !