We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 39928
    • 7 Posts
    Hi,

    Forgive my Newbie explanation from here.

    I'm trying to work the code as per http://rtfm.modx.com/display/ADDON/Login.Basic+Setup

    Downloaded and installed the Login add-on successfully

    Placed this exact code on "Home" Resource Page
    [[!Login? 
    &loginTpl=`lgnLoginTpl` 
    &logoutTpl=`lgnLogoutTpl` 
    &errTpl=`lgnErrTpl` 
    &logoutResourceId=`5` 
    &redirectToPrior=`1`]] 


    I have a chunk that i've added Personalize function as below
    [[!Personalize? 
    &yesChunk=`header_for_members` 
    &noChunk=`header_for_guest` 
    &ph=`name`
    ]]
    


    and on the "header_for_guest" chunk i had the following code
    				<div ID="topmenuforwrap02">
    					<!--START WRAPPER02-->
    					<div class="wrapheader02">
    						<!--START TOPMENUHEADERCONTENT-->
    						<div class="topmenuheadercontent">
    							<span class="tmhc"><img src="[[++base_url]]assets/templates/LiveGigs/images/lgclogo_new_alt02.png"><br>Blah ness..The Fox <span class="y">LEARN</span> <span class="o">MORE!"</span></span>
    						</div>
    						<!--END TOPMENUHEADERCONTENT-->
    						<!--START TOPMENUHEADERCONTENTRIGHT-->
    						<div class="topmenuheadercontentright">
    							<div id="container">guest
    
    [[!Login? 
    &loginTpl=`lgnLoginTpl` 
    &logoutTpl=`lgnLogoutTpl` 
    &errTpl=`lgnErrTpl` 
    &logoutResourceId=`5` 
    &redirectToPrior=`11`]] 
    
    
    
    <span id="logged_in_status">
    							</div>
    						</div>
    						<!--END TOPMENUHEADERCONTENTRIGHT-->
    					</div>
    					<!--END WRAPPER02-->
    				</div>
    </span>
    




    Within the lgnLoginTpl the code is

    <div class="loginForm">
        <div class="loginMessage">[[+errors]]</div>
        <div class="loginLogin">
            <form class="loginLoginForm" action="[[~[[*id]]]]" method="post">
                <fieldset class="loginLoginFieldset">
                    <legend class="loginLegend">[[+actionMsg]]</legend>
                    <label class="loginUsernameLabel">[[%login.username]]
                        <input class="loginUsername" type="text" name="username" />
                    </label>
                    
                    <label class="loginPasswordLabel">[[%login.password]]
                        <input class="loginPassword" type="password" name="password" />
                    </label>
                    <input class="returnUrl" type="hidden" name="returnUrl" value="[[+request_uri]]" />
    
                    [[+login.recaptcha_html]]
                    
                    <input class="loginLoginValue" type="hidden" name="service" value="login" />
                    <span class="loginLoginButton"><input type="submit" name="Login" value="[[+actionMsg]]" /></span>
                </fieldset>
            </form>
        </div>
    </div>


    Saved it and when i went back to the Home Screen, I'm not seeing any Form anywhere.

    I view sourced on the page and i noticed the code is evident.

    ..
    						<!--START TOPMENUHEADERCONTENTRIGHT-->
    						<div class="topmenuheadercontentright">
    							<div id="container">guest
    
    <div class="loginForm">
        <div class="loginMessage"></div>
        <div class="loginLogin">
            <form class="loginLoginForm" action="index.php?id=1" method="post">
                <fieldset class="loginLoginFieldset">
                    <legend class="loginLegend">Login</legend>
                    <label class="loginUsernameLabel">Username
                        <input class="loginUsername" type="text" name="username" />
                    </label>
                    
                    <label class="loginPasswordLabel">Password
                        <input class="loginPassword" type="password" name="password" />
                    </label>
                    <input class="returnUrl" type="hidden" name="returnUrl" value="" />
    
                    
                    
                    <input class="loginLoginValue" type="hidden" name="service" value="login" />
                    <span class="loginLoginButton"><input type="submit" name="Login" value="Login" /></span>
                </fieldset>
            </form>
        </div>
    </div> 
    
    
    
    <span id="logged_in_status">
    							</div>
    						</div>
    						<!--END TOPMENUHEADERCONTENTRIGHT-->
    					</div>
    					<!--END WRAPPER02-->
    ..


    However, when i inspect element on the same location it's not there. Attached.

    Any advise much welcome!

    Ken
    • If you get rid of the personalize function does it render the Login form? if so your issue may be with Personalize and not Login I would start there in order to figure out what may be causing the issue.
        Benjamin Marte
        Interactive Media Developer
        Follow Me on Twitter | Visit my site | Learn MODX
        • 39928
        • 7 Posts
        Thanks for getting back.

        I believe it's working as you can see on the header part of my page, i've labeled "guest" to make sure that the "header_for_guest" chunk is firing. attached.

        Personalized should be working but it's worth a try to just take personalize out of the context to see if that works.
        • Have you checked the MODX error log? Any clues in there?
            Benjamin Marte
            Interactive Media Developer
            Follow Me on Twitter | Visit my site | Learn MODX
            • 39928
            • 7 Posts
            Hi,

            Here's the error log.

            [2013-07-15 13:58:24] (ERROR @ /modx228/manager/index.php) Error 23000 executing statement:
            INSERT INTO `modx_register_messages` (`topic`, `id`, `created`, `valid`, `accesses`, `expires`, `payload`, `kill`) VALUES (1, '8f14e45fceea167a5a36dedd4bea2543', '2013-07-15 13:58:24', '2013-07-15 13:58:24', 0, 1373889864, 'if (time() > 1373889864) return null;\nreturn 1;\n', 0)
            Array
            (
                [0] => 23000
                [1] => 1062
                [2] => Duplicate entry '1-8f14e45fceea167a5a36dedd4bea2543' for key 'PRIMARY'
            )
            
            [2013-07-15 13:58:24] (ERROR @ /modx228/manager/index.php) Could not send message to queue 1, topic /resource/. Message payload is Array
            (
                [8f14e45fceea167a5a36dedd4bea2543] => 1

            )

              • 39928
              • 7 Posts
              Hey Benmarte,

              I'm such a doop. I just tried stripping the whole theme out and used the base template and placed the login snippet over at Home Resource. It showed. It must be a missing/extra <div> or css issue along the themed template structure. causing it to overlap or disappear along the lines. Appreciate for the follow up so far.

              Thanks.
              Ken