[TYPO3-english] 'negate' menu item if 'media' is empty
Tyler Kraft
tyler.kraft at netefficiency.co.uk
Tue May 4 13:49:55 CEST 2010
Hi
I think, from the top of my head, that something like this should work.
doNotLinkIt=1
doNotLinkIt.if.isFalse.field = media
Hth
Tyler
Victor Livakovsky wrote:
> Hi, members of a list.
>
> I have a menu, which shows an image, set in 'media' field of a page as a
> part of menu item. And those pages, that doesn't have any images in
> 'media' field shouldn't appear in menu. I partially achieved this with
> such TS:
>
> lib.imgMenu = HMENU
> lib.imgMenu {
> 1 = TMENU
> 1.NO {
> allWrap = <div class="imgEntry">|</div>
>
> beforeImg {
> import.data = field:media
> import = uploads/media/
> import.listNum = 0
> height = 134
> }
> beforeImgLink = 1
>
> # disable wrapping of item
> allWrap.if.isFalse.field = media
> allWrap.if.negate = 1
>
> # disable link text
> stdWrap.if.isFalse.field = media
> stdWrap.if.negate = 1
> }
> }
>
>
> This works good, but I'm still getting: <a href="menu/item6.html"></a>
> for a pages with empty 'media' field.
>
> I tried to play with doNotLinkIt, since it has stdWrap properties as
> well, but I can't get, how can I pass 'true' to it, when 'media' is
> empty. I'll appreciate any hints.
> Or, maybe, there is another way to disable menu item?
More information about the TYPO3-english
mailing list