Solved

Different template for logged in and logged out users

  • 6 May 2021
  • 5 replies
  • 402 views

  • New Member
  • 0 replies

I have a client whose website presents post data differently to visitors depending on whether they are logged in or logged out. Ideally I want to use ‘Display Conditions’ to specify use of Template A for logged in users and Template B for logged out users  when they are viewing a specific post.

I know how to show/hide widgets for logged in/logged out users but not whole pages.

Any ideas?

icon

Best answer by António Carreira 21 May 2021, 19:35

View original

5 replies

Userlevel 4
Badge +3

You could do that in two ways. 

 

Either two different pages and use a redirect if the user is logged in or not - you can use a simple memberhip plugin or redirect plugin for that. The second - you could use Dynamic Conditions to display a template for logged in users and one for logged out users but you will have to have that on the same page. 
 

Create the template as a template inside saved templates and add two Template widgets in the editor and the conditions to that one. I hope I understood properly what you meant. 

Userlevel 3
Badge +2

You could do that in two ways. 

 

Either two different pages and use a redirect if the user is logged in or not - you can use a simple memberhip plugin or redirect plugin for that. The second - you could use Dynamic Conditions to display a template for logged in users and one for logged out users but you will have to have that on the same page. 
 

Create the template as a template inside saved templates and add two Template widgets in the editor and the conditions to that one. I hope I understood properly what you meant. 

I agree but keep in mind that the code is going to load anyway. Or that was only for Responsive on/off?  Don’t remember @Cristi Lupchian 

Userlevel 4
Badge +3

You could do that in two ways. 

 

Either two different pages and use a redirect if the user is logged in or not - you can use a simple memberhip plugin or redirect plugin for that. The second - you could use Dynamic Conditions to display a template for logged in users and one for logged out users but you will have to have that on the same page. 
 

Create the template as a template inside saved templates and add two Template widgets in the editor and the conditions to that one. I hope I understood properly what you meant. 

I agree but keep in mind that the code is going to load anyway. Or that was only for Responsive on/off?  Don’t remember @Cristi Lupchian 

Yes - that will still be loaded - if you have sensitive info or heavy loading templates you should use a redirect option - membership or redirect third party plugin. 

Userlevel 7
Badge +6

Hi @BSA 👋  Please click “Best Answer” if you feel it has been given.

Userlevel 5
Badge +3

You could do that in two ways. 

 

Either two different pages and use a redirect if the user is logged in or not - you can use a simple memberhip plugin or redirect plugin for that. The second - you could use Dynamic Conditions to display a template for logged in users and one for logged out users but you will have to have that on the same page. 
 

Create the template as a template inside saved templates and add two Template widgets in the editor and the conditions to that one. I hope I understood properly what you meant. 

I agree but keep in mind that the code is going to load anyway. Or that was only for Responsive on/off?  Don’t remember @Cristi Lupchian

Yes - that will still be loaded - if you have sensitive info or heavy loading templates you should use a redirect option - membership or redirect third party plugin. 

 

I’ve done some tests with Dynamic Visibility for Elementor and it completely removes the code when a condition is not met. You have an option to keep the html, but if that is turned off no code will be loaded for the hidden elements.

https://wordpress.org/plugins/dynamic-visibility-for-elementor/

Reply