• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Show / Hide Form when user is logged in

Show / Hide Form when user is logged in 11 years 9 months ago #24217

  • lking
  • lking's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 24
Hello everyone,

I just have some questions to ask about how do we show / hide a form based on user login status.

For example, I have 2 forms
1. Login Form
2. Enquiry Form

- Both forms are set to display in an article using module. However, both will show up depending on user login status.
- In general, Login form (show) when user is not login, but enquiry form (Hide).
- Vice versa, when the user is logged on, the login form (Hide) but the enquiry form (Show).

So how do we hide/show the forms based on user login status?
- Let say if user is > 0 with the following code:
if($user->id > 0)
{ code to hide the login form and show enquiry form } and code of vice versa case.

Kindly advice,

Thanks alot

Regards,
The administrator has disabled public write access.

Show / Hide Form when user is logged in 11 years 9 months ago #24220

  • matt
  • matt's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 136
  • Thank you received: 14
I guess the easiest way to do this is to use Joomla user groups. Make a group for your public form (module) and a second user group just for logged in users.

Matt
The administrator has disabled public write access.

Show / Hide Form when user is logged in 11 years 9 months ago #24223

  • lking
  • lking's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 24
Hello Matt,

Yes, you are right! that's the easiest way to do. I put them into different group and set public user in that group. Well, it works!

Thanks,

Regards,
Josh
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!