Filter options

Category

Search

Reset

Add snippet

If you would like to create a new snippet, please click here:

Add snippet

Login / logout link for FE users depending on session state

Author Tags Category Date
Steffen Müller

7 snippets

TypoScript, fe_user, login, logout, condition typoscript March 22, 2010

Creates login or logout link for FE users.
- If FE user is NOT logged in, the link text is LOGIN and points to the login form page.
- If FE user IS logged in, the links text is LOGOUT and directly triggers a logout.

  1. page.10 = COA_INT
  2. page.10 {
  3. ## Login link (shown if FE user is NOT logged in)
  4. 10 = TEXT
  5. 10 {
  6. value = LOGIN
  7. typolink {
  8. parameter = 123 // pid of page with login form
  9. }
  10. if.isFalse.data = TSFE:fe_user|user|username
  11. }
  12.  
  13. ## Logout link (shown if FE user IS logged in)
  14. 20 < .10
  15. 20.if.negate = 1
  16. 20 {
  17. value = LOGOUT
  18. typolink {
  19. additionalParams = &logintype=logout
  20. }
  21. }
  22. }