Keyword

Hide Extra fields from non-registered users

More
13 years 6 months ago #95022 by Radik
I need to hide Extra fields from non-registered users. If a user is logged in Extra Fields need to show. How can I do it?

Please Log in or Create an account to join the conversation.

More
13 years 6 months ago #95023 by william white
Replied by william white on topic Hide Extra fields from non-registered users
Create an override

Edit the view your using, usually item.php, sometimes category_item.php if showing the fields in the category view.

Search for <!-- Item extra fields -->

Add the following php code above <!-- Item extra fields -->

 $user =& JFactory::getUser();  if($user->get('guest') ==0 ):

Find the bottom of the extra fields display code and add

endif

Please Log in or Create an account to join the conversation.

More
13 years 6 months ago #95024 by Radik
I did that, everything works. Thank You!

 

How to make the text 'only for registered users' for guests?

 

I write <?php else: ?> only for registered users <?php endif; ?> , but didn't work.

Please Log in or Create an account to join the conversation.

More
13 years 6 months ago #95025 by Radik
Thank You very much for help!

 

I put this <?php if($user->get('guest') ==1 ): ?> text for guest <?php endif; ?>

 

Thank You very much for help!

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum