Changed TAB IF Statement

Discussion in 'Templates customization' started by emailcontactor, Dec 10, 2012.

  1. emailcontactor

    emailcontactor aMember Pro Customer

    Joined:
    Jul 25, 2011
    Messages:
    2
    we are using a custom theme and would like to add a IF statement to change our SIGNUP and MEMBERS AREA tabs if a user is logged in or not.

    Source:

    Code:
    <div id="navigation">
                    <ul>
                        <li><a href="/">Home</a></li>
                        <li><a href="/members/login" class="active">Members Area</a></li>
                        <li><a href="/members/signup">Sign Up</a></li>
                    </ul>
                </div>

    We use a class="active" tag to highlight the tag.

    Does anyone know what the IF STATEMENT code should be?
  2. everbatim

    everbatim aMember Pro Customer

    Joined:
    Dec 19, 2007
    Messages:
    65
    Are you trying to change what they see based on if they are just logged in or not, or if they have already purchased something or not?
  3. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    You can use am_lite API for this:
    http://www.amember.com/docs/API/Lite
    PHP:
    <?php
    include "/amember/library/Am/Lite.php";
    $lite Am_Lite::getInstance();
    ?>
    <div id="navigation">
                    <ul>
                        <li><a href="/">Home</a></li>
                        <?php if($lite->isLoggedIn()) : ?>
                        <li><a href="/members/login" class="active">Members Area</a></li>
                         <?php else :  ?>
                        <li><a href="/members/signup">Sign Up</a></li>
                         <?php endif; ?>
                    </ul>
                </div>

Share This Page