Discussion:
[TYPO3-english] Show image if menu is empty
Pero Peric
2013-06-25 20:02:59 UTC
Permalink
Hi,

I asked similar question few days ago but nobody answered, so i'll try
to make it simple:

How to show an image instead of menu if menu is empty?

Thx.

Regards.
Kay Strobach
2013-06-25 20:43:54 UTC
Permalink
Hello Pero,

in TYPOScript you do have conditions stdWrap

http://wiki.typo3.org/De:stdWrap#ifEmpty

This way you're able to check wether the menu created no code and then
you can provide an alternative rendering

stdWrap also contains a cObject, so that you can render whatever you
want as alternative :D

Regards
Kay
Post by Pero Peric
Hi,
I asked similar question few days ago but nobody answered, so i'll try
How to show an image instead of menu if menu is empty?
Thx.
Regards.
--
http://www.kay-strobach.de - Open Source Rocks

TYPO3 .... inspiring people to share!
Get involved: http://typo3.org

Answer was useful - feel free to donate:
-
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=KPM9NAV73VDF2
- https://flattr.com/profile/kaystrobach
Pero Peric
2013-06-25 22:03:53 UTC
Permalink
Post by Kay Strobach
Hello Pero,
in TYPOScript you do have conditions stdWrap
http://wiki.typo3.org/De:stdWrap#ifEmpty
This way you're able to check wether the menu created no code and then
you can provide an alternative rendering
stdWrap also contains a cObject, so that you can render whatever you
want as alternative :D
Thank you for help. May i ask you to write a simple example for menu? I
searched for some example but didn't find it. I really don't know where
to put ifEmpty. Thx.

Regards.
Ralf-Rene Schröder
2013-06-26 01:14:36 UTC
Permalink
I really don't know where to put ifEmpty.
something like this should help you...

10 = HMENU
10 {
stdWrap.ifEmpty.cObject = IMAGE
stdWrap.ifEmpty.cObject {
... your image stuff
}
... your menu staff
}

or another way:

10 = IMAGE
10 {
override.cObject = HMENU
override.cObject {
... your menu staff
}
... your image stuff
}
--
image[FORMAT] - Ralf-Ren? Schr?der
http://www.image-format.eu ... Wir geben Ihrem Image das richtige Format
Pero Peric
2013-06-26 08:41:42 UTC
Permalink
Post by Ralf-Rene Schröder
I really don't know where to put ifEmpty.
something like this should help you...
10 = HMENU
10 {
stdWrap.ifEmpty.cObject = IMAGE
stdWrap.ifEmpty.cObject {
... your image stuff
}
... your menu staff
}
Wow, this works! :-) Thank you for help :-)

Regards.

Loading...