Userinfo for currently logged in user

Submitting your vote...
Rating: 4.6 of 5. 19 vote(s).
Click the rating bar to rate this item.

This snippet shows info on the user who is currently logged in.

If no user is logged in, no info is shown.

The snippet shows how to access the various special fields, like usergroups and images.

 

lib.userinfo = COA_INT
lib.userinfo {
  10 = TEXT
  10.data = TSFE:fe_user|user|username
  10.wrap = Username:&nbsp;|<br />
  10.required = 1
   
  20 = COA
  20.1 = TEXT
  20.1.data = TSFE:fe_user|user|first_name
  20.1.required = 1
  20.2 = TEXT
  20.2.data = TSFE:fe_user|user|last_name
  20.2.wrap = &nbsp;|
  20.2.required = 1
  20.stdWrap.ifEmpty.data = TSFE:fe_user|user|name
  20.stdWrap.wrap = Name:&nbsp;|<br />
  20.stdWrap.required = 1
   
  30 <.10
  30.data = TSFE:fe_user|user|address
  30.wrap = Address:&nbsp;|<br />
   
  40 <.10
  40.data = TSFE:fe_user|user|city
  40.wrap = City:&nbsp;|<br />
   
  50 <.10
  50.data = TSFE:fe_user|user|zip
  50.wrap = Zip:&nbsp;|<br />
   
  60 <.10
  60.data = TSFE:fe_user|user|country
  60.wrap = Country:&nbsp;|<br />
   
  70 <.10
  70.data = TSFE:fe_user|user|company
  70.wrap = Company:&nbsp;|<br />
   
  80 <.10
  80.data = TSFE:fe_user|user|telephone
  80.wrap = Telephone:&nbsp;|<br />
   
  90 <.10
  90.data = TSFE:fe_user|user|fax
  90.wrap = Fax:&nbsp;|<br />
   
  100 <.10
  100.data = TSFE:fe_user|user|email
  100.typolink.parameter.data = TSFE:fe_user|user|email
  100.wrap = Email:&nbsp;|<br />
   
  110 <.10
  110.data = TSFE:fe_user|user|www
  110.typolink.parameter.data = TSFE:fe_user|user|www
  110.typolink.extTarget = _blank
  110.wrap = WWW:&nbsp;|<br />
   
  200 < .10
  200.data = TSFE:fe_user|user|usergroup
  200.split {
    token = ,
    cObjNum = 1 || 2
    1 {
      10 = CONTENT
      10.table = fe_groups
      # ID 13 is the folder where I have my FE users and FE groups stored.
      # Remember to change it to the ID of the folder where YOU are storing your FE data!!
      10.select.pidInList = 13 
      10.select.andWhere.current = 1
      10.select.andWhere.wrap = uid=|
      10.renderObj = TEXT
      10.renderObj.field = title
      10.renderObj.wrap = |,
    }
    2 < .1
    2.10.renderObj.wrap >
  }
  200.wrap = Member of group(s):&nbsp;|<br />
   
  300 < .10
  300.data = TSFE:fe_user|user|image
  300.split {
    token = ,
    cObjNum = 1
    1 {
      10 = IMAGE
      10.file.import.current = 1
      10.file.import = uploads/tx_srfeuserregister/
      10.file.width = 100
    }
  }
  300.wrap = Image(s):&nbsp;|<br />
   
}
page.100 < lib.userinfo 

 

This snippet was submitted by Peter Klein



Comments


Jigal, 19-12-06 11:54:
Should this work with T3 v.3.8.1?
It sure doesn't display anything.

I'd like to use the TSFE:fe_user|user|language field for the language settings, like:
[globalVar = TSFE:fe_user|user|language=1]
config {
sys_language_uid = 1
language = de
locale_all = de_DE
}
[globalVar = TSFE:fe_user|user|language=2]
config {
sys_language_uid = 2
language = fr
locale_all = fr_FR
}
[global]

Should that be possible somehow?
Peter, 20-12-06 16:07:
@Jigal:
Older versions of TYPO3 can only read TSFE vars in 2 level from TypoScript, and to get FE user info, you need 3 levels. (I can't remember in when it was fixed, but apparently not in 3.8.1)

Your idea of using Conditions should work, but again it might not work in older TYPO3 versions.

Add comment

* - required field

*



*
*

Top 10 Updates

Contact us geändert am  21-Jul-2013 09:33:07
Contact us geändert am  21-Jul-2013 09:33:03
Useful Links geändert am  24-Apr-2013 06:31:20
Nice fonts using Google font API geändert am  20-May-2010 14:36:47
TS-based Searchbox for Indexed Search  geändert am  18-May-2010 16:27:15
TYPO3 SEO geändert am  30-Apr-2010 07:44:22
Search engine friendly graphical headers in TYPO3 geändert am  30-Apr-2010 07:33:44
Creating a simple Infocenter using TYPO3 geändert am  17-Nov-2009 11:12:52
Making the Section Menu work correctly with TemplaVoila geändert am  05-May-2009 10:27:17
Show pages with type "Not in Menu" in a sitemap geändert am  05-May-2009 10:11:17

Latest comments

20-May-2015 15:36:04
Pharma602 Pharma602 schrieb: Very nice site!
Modern Guestbook 1.6.11 maxPages patch
20-May-2015 15:35:24
Pharmc607 Pharmc607 schrieb: Very nice site! cheap goods http://yieopxa2.com/yxyaxvx/4.html
Modern Guestbook 1.6.11 maxPages patch
20-May-2015 15:34:22
Pharma747 Pharma747 schrieb: Very nice site! <a href="http://yieopxa2.com/yxyaxvx/1.html">cheap goods</a>
Modern Guestbook 1.6.11 maxPages patch
Deutsch
Search: