View Single Post
  #4  
Old 10-30-2007, 01:47 PM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: Is this correct coding?

Doug,

You are going to LOVE Samrty!

One thing -- if you do an if/else for $usertype eq "C" -- thee are also possible usertypes that are not admin, such as "partner" if you use the x-affiliate module. So, sometimes if you want something FOR the admin only, it's best to code FOR $usertype eq "A" and not for the "C" --

Code:
<table class="Container" cellpadding="0" cellspacing="0" {if $usertype eq "A"} width="{$width|default:"100%"}" {else} width="{$width|default:"970px"}" align="center"{/if} > <tr> <td class="Container">

Quote:
But will that way of writing it center the Admin area too?

No - if you want to center the admin too, then move the closing {/if} BEFORE the align="center"

You'll get it... just keep trying stuff and Smarty will make it clear what works and what doesn't.

Have fun!

Jeremy
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote