Customing template depending on field values

Discussion in 'Templates customization' started by harthacanute, Mar 5, 2007.

  1. harthacanute

    harthacanute New Member

    Joined:
    Feb 25, 2007
    Messages:
    14
    Hello. I need to alter the member.html page so that some things are 'hidden' for users.

    I know almost nothing about programming, but I succeeded in doing this, using an IF .... ENDIF statement.

    For example...

    {if $smarty.session._amember_user.name_f == "Bob"} etc.

    and then putting stuff before the endif.

    That's great, but it only works for a firstname.

    So I've created a custom text field called 'restricted', which only I have access to. It defaults to 'N'. However, for some users, I want to set it as 'Y'. The parts about changing the password / email address will be hidden for these users.

    What do I put for the 'if' statement?

    Is it something like: {if $smarty.session._amember_user.restricted == "Y"}

    I'm hoping it's something that easy. Any help would be appreciated. I'm not a programmer, so simple answers are appreciated!

    Thanks.
  2. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    if field is added as "SQL field", then
    {if $smarty.session._amember_user.restricted == "Y"}
    if fields is added as "Common field" then
    {if $smarty.session._amember_user.data.restricted == "Y"}
  3. harthacanute

    harthacanute New Member

    Joined:
    Feb 25, 2007
    Messages:
    14
    Thanks Alex - I'll try that.

Share This Page