- Posts: 1
COMMUNITY FORUM
Show some extra fields / hide others
- Chris
-
Topic Author
- Offline
- New Member
Less
More
11 years 8 months ago - 11 years 8 months ago #120719
by Chris
Show some extra fields / hide others was created by Chris
I am trying to figure out what code to add to my item.php to show a subset of extra fields to all users and the full set to a specific user group.
I found this thread, but can't quite seem to get it to work - forum.joomla.org/viewtopic.php?p=2725146
Here is an example of what I am trying:
I found this thread, but can't quite seem to get it to work - forum.joomla.org/viewtopic.php?p=2725146
Here is an example of what I am trying:
Log in or Create an account to join the conversation.
- Mohamed Abdelaziz
-
- Offline
- Platinum Member
- Joomla Developer
11 years 8 months ago #120720
by Mohamed Abdelaziz
Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store
Replied by Mohamed Abdelaziz on topic Re: Show some extra fields / hide others
Hi, it need small modifications, please try this:
<?php if(JFactory::getUser()->guest) {
//do user logged out stuff
?>
<li><?php echo $this->item->extraFields->alias1->value ;?></li>}
else {
//do user logged in stuff
<li><?php echo $this->item->extraFields->alias1->value ;?></li>
<li><?php echo $this->item->extraFields->alias2->value ;?></li>
<li><?php echo $this->item->extraFields->alias3->value ;?></li>
<?php } ?>
Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store
Please Log in or Create an account to join the conversation.