[TYPO3] Putting newloginbox login form in every page disables FE caching?

Bernhard Kraft kraftb at kraftb.at
Fri Aug 18 05:18:38 CEST 2006


Ricardo Pereira wrote:

> That's a great idea, thanks!
> 
> But how can I hide the login form when the user is logged in? And hiding
> the login form would also disable the cache, wouldn't it?
> 
> Seems like I'm heading to a dead-end here :( Or maybe I'm just plain wrong.
> 
> Thanks for helping out anyway!! I really appreciate it.

do something like:

---------------
page.10.subpart.loginForm = TEXT
page.10.subpart.loginForm.value (
  <input type="text" name="user" value="" />
  <input type="text" name="pass" value="" />
  <input type="hidden" name="logintype" value="login" />
  <input type="hidden" name="pid" value="###YOUR_FEUSER_PID###" />
)
[loginUser = *]
page.10.subpart.loginForm.value (
  <input type="hidden" name="logintype" value="logout" />
)
[end]
--------------

By using a condition you will create cached-versions for both cases - when the condition matches
and when it doesn't.

So TYPO3 will just have a short look if the same conditions as at a previous call get matches and
if there is a page in cache for such a case it will serve the cached page ....

You only have to notice that you can-not add the currently logged-in username to the conditional
part (when a user is logged in) - cause this would result in different versions for every user and
in T3 caching is done on a group-level basis
(this comes into play when you set Pages or content elements to be valid for different usergroups -
then for all those groups versions will get created in cache)



greets,
Bernhard
-- 
----------------------------------------------------------------------
"Freiheit ist immer auch die Freiheit des Andersdenkenden"
Rosa Luxemburg, 1871 - 1919
----------------------------------------------------------------------
[[ http://think-open.at | Open source company ]]



More information about the TYPO3-english mailing list