[Typo3] insert page content in templates?

Christopher bedlamhotel at gmail.com
Mon Jun 27 18:16:51 CEST 2005


Aha,

On 27/06/05, Peter Russ <peter.russ at 4many.net> wrote:

> > Yes: search the mailing list archives/faqs/howtos :^)
> >
> > http://typo3.org/documentation/mailing-lists/english-main-list-archive/thread/196/?tx_maillisttofaq_pi1%5Bmode%5D=5&tx_maillisttofaq_pi1%5Bsword%5D=login&tx_maillisttofaq_pi1%5Banswered_only%5D=0
> >
> > -Christopher
> But the answer there is NOT quite correct as NO fe_user.inc is required
> to get the ###USERNAME### displayed ;-)

You're right, sorry! I hadn't realized that it showed the 'old school'
way. Anders, here's a more up-to-date  (and slightly simpler) way,
complete:

# Login stuff:

lib.forms.logout = COA
lib.forms.logout {
5 = COA
5 {
    stdWrap.dataWrap = <form action="index.php?id={TSFE:id}"
method="post">|</form>

    5 = HTML
    5.value = <p><strong>You are logged in as:
[<!--###USERNAME###-->]</strong> <input name="submit"
id="tx-newloginbox-pi1-logout_submit" value="Logout" type="submit"
class="button" /></p>
	
    10 = HTML
    10.value = <input name="logintype" value="logout" type="hidden" />

    15 = HTML
    15.value = <input name="pid" value="3" type="hidden" />
  }
}

lib.forms.login = COA
lib.forms.login {
  stdWrap.dataWrap = <form action="index.php?id={TSFE:id}"
method="post">|</form>

  5 = HTML
  5.value (
    <p><strong>Registered user login:</strong></p>
    <p>
      <label for="tx-newloginbox-pi1-user">Username:</label> <input
name="user" value="" id="tx-newloginbox-pi1-user" type="text"
class="field" />
    </p>
    <p>
      <label for="tx-newloginbox-pi1-pass">Password:</label> <input
name="pass" value="" id="tx-newloginbox-pi1-pass" type="password"
class="field" />
    </p>
    <p>
      <input name="submit" value="Login"
id="tx-newloginbox-pi1-login_submit" type="submit" class="button"
/></p>
    </p>
    <input name="logintype" value="login" type="hidden" />
    <input name="pid" value="3" type="hidden" />
    <input name="redirect_url" value="" type="hidden" />
 )
}

In this site, lib.forms.logout and lib.forms.login are part of the
page header. Here's the simplified header:

lib.layout.header = COA
lib.layout.header {
  10 = COA
  10.wrap = <div id="userMenu">|</div>

  # Show the login form:
  10.5 < lib.forms.login
}

### When someone's logged in:
[usergroup = *]
### Show the logout form instead:
lib.layout.header.10.5 < lib.forms.logout
[global]


Sorry about pointing you to the outdated method.


-Christopher



More information about the TYPO3-english mailing list