Hidden content if user is logged in - HOW TO?

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
jakovbak
Forum Members
Forum Members
Posts: 225
Joined: Thu Dec 13, 2012 2:54 pm

Hidden content if user is logged in - HOW TO?

Post by jakovbak »

Hello everyone!
I've been looking and searching all around but I can't find a solution for the following problem:

1) There is a link named "Log-in" and it leads to the page with login form. Once user is logged in this link must change to "Log-out".
Is it possible to achieve such change with some smarty magic?

2) There is a log-in form and registration button and below is contact form protected by FEU. Once user is logged in, contact form appears but registration button remains.
Is it possible to hide some elements - like registration button - if user is logged in and obviously doesn't need to register anymore? Again I believe it could be done with smarty but have no clue how to get there...

To illustrate this situation a little bit better, I have created a testing page at:

http://www.adriaticsolution.hr/index.php?page=testing

You can use following for log-in:
username: test@test.com
password: test2017AS

Maybe I'm missing something obvious but I've been struggling with this for days and still can't figure out how to do it. Every hint would be very appreciated!
Thank you all in advance and best regards,
Jakovbak
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: Hidden content if user is logged in - HOW TO?

Post by Rolf »

- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
jakovbak
Forum Members
Forum Members
Posts: 225
Joined: Thu Dec 13, 2012 2:54 pm

Re: Hidden content if user is logged in - HOW TO?

Post by jakovbak »

Hello Rolf and thank you so much! I'm on the bus from work right now and can't try it but from what I have read it could be exactly what I was looking for!
One more question - if it's not inappropriate - about page behaviour after login process:
- If the login process started on page XY like in my example, is it possible at the end of that process to hit some 'back' button to go back to XY page but also to reload the page so that previously hidden contact form is now visible?
Best regards,
Jakovbak
Post Reply

Return to “Modules/Add-Ons”