Different Enquiry forms based on logged in condition

Need to display template depending on customer login and log out.

In the view section, we can define a profile model to get customer weather logged in or not. and pass the flag through it. on the template if it is true pass one template , Otherwise show another template.

getContext: function ()
				{
					var profile = ProfileModel.getInstance();
					var is_logged_in = profile.get('isLoggedIn') === 'T' && profile.get('isGuest') === 'F'
					//@class SiteSearch.View.Context
					return {
						is_logged_in: is_logged_in
					};
					//@class SiteSearch.View
				}

On the template need to pass conditions

{{#if is_logged_in}}
contents
{{else}}
contents
{{/if}}

Leave a comment

Your email address will not be published. Required fields are marked *