Display fields only to the item Owner

  • Published by
    George Papadakis
  • Last modified
    28 October 2013
  • Up to date
    Yes
  • Concerns
    Plugins Template
  • Since Version
    1.5.6
  • Voting
    Average rating
    2 votes
    • 1
    • 2
    • 3
    • 4
    • 5
  • Favourites
    317 Display fields only to the item Owner /documentation/tutorials-english/81-acl/317-display-fields-only-to-the-item-owner.html

There is no Access (view) Level for owners

Nevertheless it is possible to display a field to items owner only:

-- for item view (file item.php)

 

$curr_user= JFactory::getUser();
if ($curr_user->id == $this->item->created_by) {
	FlexicontentFields::getFieldDisplay($this->item, 'fieldname');
	echo $this->item->fields['fieldname']->label .": ";
	echo $this->item->fields['fieldname']->display;
}
 

 

 

-- for category view (file category_items.php) use either $items[$i] or $item instead of $this->item