[TYPO3] sitemap w/ abstract - totally suppress menu item if no abstract?

Loek Hilgersom hilgersom at xs4all.nl
Fri Jul 11 12:49:26 CEST 2008


Hi Paul,

What about trying to use the abstract field as the main menu item field, and 
then wrap the rest conditionally using required = 1 ?
Something like this:

	NO.stdWrap = TEXT
	NO.stdWrap {
		field = abstract
		required = 1
		dataWrap = <li>{field:title}<p>|</p></li>
	}

You'll have to adjust it to your requirements, but I think it does what you're 
looking for.

Loek


Paul Vetch wrote:
> Hi,
> 
> I'm trying to tweak the sitemap with abstract (tt_content.menu.20.4) so 
> that if there is no abstract data for a page then *nothing* at all is 
> output for that page - no title, no link, no nothing.  Trouble is I 
> can't get it to work, and I'm beginning to wonder if I can actually do 
> this with a TMENU at all...?   I've tried a condition on 
> allWrap.cObject, and I can easily get conditional output depending upon 
> whether or not there's an abtract, but I can't totally suppress the 
> output if there's no abstract, and that's what I need.
> 
> What I really want to be able to do is the equivalent of 
> NO.if.isTrue.field = abstract ... :)
> 
> My temporary, horrible 'solution' at the moment is use allWrap.override 
> to place a div with display:none around the menu items I don't want!  
> I'm really traumatised by the inelegance of this - I'd be very happy if 
> someone could put me out of my misery.
> 
> FWIW my TS at the moment is
> 
> tt_content.menu.20.4 {
>  wrap = <div class="sm">|</div>
>  1 = HMENU
>  1 {
>    special = directory
>    special.value.field = pages
>    1 = TMENU
>    1 {
>      noBlur = 1
>      NO {
>        allWrap = <li>|</li>
>        allWrap.override = <li style="display:none">|</li>
>        allWrap.override.if.isFalse.field = abstract
>        stdWrap2.wrap = <h3>|</h3>
>        linkWrap = |<b>Read this article...</b>
>        ATagParams =
>        ATagBeforeWrap = 1
>        ATagTitle.field = title
>        stdWrap.htmlSpecialChars = 1
>        after {
>          required = 1
>          data = field:abstract
>          wrap = <p>|</p>
>        }
>      }
>    }
>  }
> }
> 
> Thanks as always
> 
> Paul
> 
> 


More information about the TYPO3-english mailing list