Keyword

How do I make extra fields visible to registered users alone

  • David Michael
  • David Michael's Avatar Topic Author
  • Offline
  • New Member
More
7 years 2 months ago - 7 years 2 months ago #160474 by David Michael
Please help,
I have a demo website, I want to show extra fields to registered users alone. I have searched through every forum but havnt been able to find an answer. Dont know what code to change or even the code to write to effect this. Any help will be much appreciated.
All i want is for the item view page not to show extra fields unless the person viewing is a registered member.
Thanks you

Edit: i believe what i want to do is to show 'extra field group to registered users. So i will appreciate if anyone can help with the code for this.
Thanks again
Last edit: 7 years 2 months ago by David Michael. Reason: update

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 2 months ago #160487 by Krikor Boghossian
Replied by Krikor Boghossian on topic How do I make extra fields visible to registered users alone

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • David Michael
  • David Michael's Avatar Topic Author
  • Offline
  • New Member
More
7 years 2 months ago #160493 by David Michael
Thank you admin for the response. However the link you pointed me to isnt of much help. I am very poor at php, from all i have been reading, i have noticed i just need to edit the k2 item.php in my template override. However, i dont know what code in specific or how to go about it. I will so much appreaciate a noob guide. I can send you the details of the webpage to have a look for me. Thanks again for taking time from your busy schedule to reply me.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 2 months ago #160508 by Krikor Boghossian
Replied by Krikor Boghossian on topic How do I make extra fields visible to registered users alone
        $user = JFactory::getUser();
 
        if ($user->guest) {
                echo "<p>You must login to see the content. I want your email address.</p>";
        } else {
          // PASTE THE TEMPLATE"S CODE FOR EXTRAFIELDS
}

As for the actual code which is used for the extrafields you can look at the item.php file's comments in order to identify the block or you can ask your template's provider.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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


Powered by Kunena Forum