Post by Housy » Tue Jul 28, 2009 5:17 am

Hey, it's me again ;D

I just don't understand, why am i getting so many notifications (notice) like --> "Notice: Undefined variable: text_forgotten_password in C:\wamp\www\mtshop\catalog\view\theme\default\template\common\header.tpl on line 18", when i'm trying to create a static login on the page. I want my login form to be visible all the time, except when user is logged into a shop, he would see just logout for example.

I was looking in the login.tpl file, what is the code and i tryed to put something together, but it doesn't work as it should.

This is header.tpl

Code: Select all

<div id="header">

    <div id="inside">
                
        <a href="<?php echo $home; ?>"><img src="<?php echo $logo; ?>" alt="<?php echo $store; ?>" /></a>
                
        <div id="login">
            
            <?php if (!$logged) { ?>
                
            <p class="login_text">PRIJAVA</p>
                    
            <form method="post" action="<?php echo $action; ?>" enctype="multipart/form-data">
                    
                <input class="text" type="text" name="email" value="<?php echo $entry_email; ?>" />
                <input class="pass" type="password" name="password" value="*************" />
                        
                <a href="<?php echo $forgotten; ?>"><?php echo $text_forgotten_password; ?></a>
                        
                <a onclick="$('#login').submit();" class="login"><?php echo $button_login; ?></a>
                        
                <div id="login_line">&nbsp;</div>
                        
                <p class="new_user">Če ste nov uporabnik in<br />se želite registrirati,<br />kliknite tukaj.</p>
                
                <?php if ($redirect) { ?>
                
                <input type="hidden" name="redirect" value="<?php echo $redirect; ?>" />
                
                <?php } ?>
                    
            </form>
            
            <?php } else { ?>
            
            <a href="<?php echo $logout; ?>"><img src="catalog/view/theme/default/image/icon_logout.png" alt="" /><?php echo $text_logout; ?></a>
            
            <?php } ?>
                
        </div>
        
    </div>

</div>
What am i doing wrong?

Tnx, Housy

Newbie

Posts

Joined
Tue Jul 28, 2009 12:30 am

Post by readyman » Thu Jul 30, 2009 11:54 am

Yeah, you need to get the variables that are set in the login file and put them in the header file. ie. if you see a variable in login.tpl and you move it to header.tpl, then you need to do the same move from the controller files from login.php to header.php.
The variable is linked parallel, you can't grab a variable from one file and place it in another view file.

http://www.alreadymade.com
Follow me on twitter.com/alreadymade


User avatar
Global Moderator

Posts

Joined
Wed May 20, 2009 5:16 am
Location - Sydney
Who is online

Users browsing this forum: No registered users and 4 guests