JoomlaWorks
Go!
Member Dashboard
Home
Extensions
Commercial
Frontpage Slideshow
Simple Image Gallery Pro
Free
K2
AllVideos
DISQUS Comments for Joomla!
IAKI (Import As K2 Image)
Quick Menu (for Joomla 4)
Simple Image Gallery
Simple RSS Feed Reader
Free On Github
Akismet for Kunena
Fill It Up
K2 Example Plugin
K2 Links for JCE
Rebuild K2 Image Cache (CLI utility for K2)
URL Normalizer
User Extended Fields for K2
Demos
Joomla Extension Demos
WordPress Plugin Demos
Labs
Joomla 3.x UTD
Web Apps
JSON 2 JSONP
Feed Reader (bookmarklet)
Device Info
Support
Documentation for Joomla Extensions
AllVideos
Frontpage Slideshow
Simple Image Gallery
Simple Image Gallery Pro
Get Help
Community Forum
Recent Topics
Categories
Create free account
Help Desk
Contact Us
About
Blog
Company
License & Terms of Service
Privacy Policy
My Account
COMMUNITY FORUM
Community Forum
Search the forum
Index
Recent Topics
Search
Log in
Username
Password
Log in
Remember me
Forgot your password?
Forgot your username?
Create an account
Forum
K2 Community Forum
English K2 Community
Hide Extra fields from non-registered users
Hide Extra fields from non-registered users
English K2 Community
3 replies
844 views
Radik
15 years 8 months ago
#95022
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?
Copy link
william white
15 years 8 months ago
#95023
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
Copy link
Radik
Topic Author
15 years 8 months ago
#95024
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.
Copy link
Radik
Topic Author
15 years 8 months ago
#95025
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!
Copy link
Log in
or
create an account
to reply.