[TYPO3-english] Show usergroup and fe_user info
bernd wilke
t3ng at bernd-wilke.net
Fri Nov 8 14:58:50 CET 2013
Am 08.11.13 14:31, schrieb Miguel:
> Hello Bernd.
>
> OMG, you are absolutelly right, your code completely did the trick !
> Thank you so much !!!
>
> After your "magic", i started to work on my second point: showing the
> usergroup in the frontend.
>
> I managed to almost suceed this task, but now i need one small
> verification step: the usergroup value is stored in the same field as
> before (the first character of the column
> "tx_itypoexpiringfegroups_groups") so nothing hard to do so far.
>
> However, if the user does not belong to a timed usergroup, the field
> stays empty, so of course it doesnt show anything...So, the logic thing
> that must be done, is that IF the field
> "tx_itypoexpiringfegroups_groups" is empty, the usergroup must be
> searched in the column usergroup.
> To achieve this, this what i have written :
>
> 10 < .10
?????
copy 10 from local 10 ???
this does not make any sense
> 10.data = TSFE:fe_user|user|tx_itypoexpiringfegroups_groups
> 10.split {
> token = |
> cObjNum = 1 |*| 2 |*| 2
> 1 {
> 10 = CONTENT
> 10.table = fe_groups
> 10.select.pidInList = 26 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 >
> }
> 20.if {
> value.data.isFalse.noTrimWrap = header
> value = |Group: |
> }
>
>
> It's kind a long shot, but what is wrong with my code?
> Thank you once again for the advices and attention
also a complicated solution
10 = TEXT
10.data = TSFE:fe_user|user|tx_itypoexpiringfegroups_groups
10.stdWrap.split {
# split input string at '|'
token = |
# assign to rendering cases 1 2 3
# (see optionsplit[2] first medium last)
cObjNum = 1 |*| 2 |*| 3
1 {
10 = CONTENT
10.table = fe_groups
10.select.pidInList = 26
10.select.andWhere.current = 1
10.select.andWhere.wrap = uid=|
10.renderObj = TEXT
10.renderObj.field = title
10.renderObj.wrap = Mitglied in der Gruppe "|"
}
// 2 do not render at all, just render the enddate:
# use current data
3.current = 1
# format as date
3.strftime = %b-%d-%Y, %H:%M
3.noTrimWrap = | bis ||
}
20 = CONTENT
20 {
table = fe_groups
select.pidInList = 26
select.andWhere.field = usergroup
select.andWhere.wrap = uid=|
renderObj = TEXT
renderObj.field = title
renderObj.wrap = Mitglied in Gruppe "|"
# das folgende isFalse sollte nur notwendig sein, wenn die Einträge von
tx_itypoexpiringfegroups_groups nicht auch in den normalen
Benutzergruppen drin stehen:
isFalse.field = tx_itypoexpiringfegroups_groups
}
beides funktioniert natürlich nur, solange es jeweils nur einen
einzelnen Eintrag gibt. Ansonsten muss da noch ein split vorgeschaltet
werden. und das ganze dann im renderObj abgearbeitet werden
bernd
--
http://www.pi-phi.de/cheatsheet.html
More information about the TYPO3-english
mailing list