Jump to content

[SOLVED] How to have the same class with different attributes when logged in or logged out


Recommended Posts

Hello,

 

I am a bit stuck with the following problem. I am trying to show a different product list for when the user is logged in or logged out.

 

As default when the user is logged out I have a left-center-right column for my product list. (file: product-list.tpl)

 

I would like to get rid of the right column and change the size of my center column when the user is logged in for example. That means that ideally I would use the same classes but with different attributes depending on if the user is logged in or not.

 

I know the existence of {if $logged} ... {/if} but it's not enough to solve my problem

 

Is there a workaround this?

 

Many thanks for your time on this.

 

Guillaume

Link to comment
Share on other sites

footer.tpl

change:
 

				<div id="right_column" class="column grid_2 omega">
					{$HOOK_RIGHT_COLUMN}
				</div>

to:

				{if $logged} <div id="right_column" class="column grid_2 omega">
					{$HOOK_RIGHT_COLUMN}
				</div>{/if}

header.tpl

change

<div id="center_column" class=" grid_5">

to:

<div id="center_column" class="{if $logged}grid_7 alpha omega{else} grid_5{/if}">
Link to comment
Share on other sites

thank you for confirmation that it works

i can go ahead and mark topic title as solved.

if you will need any additional assistance related to this case - feel free to continue discussion below

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...