[TYPO3-ttnews] new feature: Optionsplit for tt_news

Rupert Germann rupi at gmx.li
Tue Apr 29 12:19:09 CEST 2008


Sylvia Boback wrote:
>> *OPTIONSPLIT* FOR TT_NEWS
> YEAH !!! Finally ;) Thanks a lot!!!!!

you're welcome ;-)
 
> Unfortunately I have a problem using the optionsplit concerning the
> alternating Layout.
...
> Do I also need to specify the alternatingLayouts property?

no. altLayoutsOptionSplit disables alternatingLayouts 
 
> What I want to do:
> I would like to use another template for the last item in my latest list.
> According to your documentation above:
> 
> plugin.tt_news {
>   altLayoutsOptionSplit = 0 |*| 0 |*| 1
> }
> 
> would do just fine. Unfortunately it doesn't.

the problem is the 0 which is not detected as a value by OptionSplit if it
is the only number in an OptionSplit section
 0||1|*|... works
 0||*|... doesn't

I'd consider this as a bug in OptionSplit

workaround:
start your templateparts with 1 instead of 0

> If I use this expression all templates are the same.
> In case the expression is : 0|*|0|*|1  without spaces the NEWS_1 template
> is used
> In case the expression is : 0 |*| 0 |*| 1 with spaces the NEWS template is
> used

spaces in optionsplits are not trimmed so ' 1 ' is NOT '1'  
 
> I have four items in my news-latest-view.
> So:  0||0||0||1 works fine
> But when the number of items will change... it won't work anymore...the
> way I want it to.
> 
> plugin.tt_news {
>   altLayoutsOptionSplit = 0||1|*|1||0||0|*|0||0||1
> }
> will display four items as the order shows : ( news news_1 news_1 news)
> 
> So: Why does the option split does not work in my case? Have I read an
> important information over? Have I missed something?

the "limit" parameter is important, too
for smthg. like:
0||1|*|1||0||0|*|0||0||1

you would need to set the limit to: 
2+3*x+3*x (x is 1 or more)
= 8 or 11 or 14 ....

otherwise parts of some sections are left out.
the priority is: last, first, middle.

hth & greets
rupert











More information about the TYPO3-project-tt-news mailing list