[Typo3] condition for media field, simpler then [userFunc] ?
JoH
info at cybercraft.de
Wed Feb 2 19:11:54 CET 2005
> May anybody could help me out? I don't have access on localconf.php.
> Thats why I try to find another solution for checking the current page
> and its media field.
>
> I want to bind the random pic plugin, when nothing is set on the
> current page.
>
> the goal is a substitution for this kind of script:
>
> [userFunc = user_checkPagemedia({$pageUid})]
> lib.media = IMAGE
> lib.media.file {
> import.data = levelmedia: 4, slide
> import = uploads/media/
> import.listNum = 0
> }
>
> [else]
>
> lib.media < plugin.tx_randompic
>
> [end]
>
> subparts.media < lib.media
Have a look at TSref --> stdWrap --> ifEmpty
This can be combined with a cObject.
Something like
10 = COA
10 {
10 = TEXT
10.field = title
stdWrap.ifEmpty.cObject = COA
stdWrap.ifEmpty.cObject {
10 = TEXT
10.value = whatever
}
}
will give you "whatever" each time the field "title" is empty.
Modify this to your needs and you will get it without any condition.
Joey
More information about the TYPO3-english
mailing list