[TYPO3] Changing the rendering of a single content element

Erik Svendsen erik at linnearad.no
Mon Oct 23 21:48:17 CEST 2006


Hello Vlatko,

> After a week of strugle I must come back and look for help. My task is
> to change the rendering of news content element via TS. Now, normaly
> this is easy, but I have two instance of news on the same page and I
> need to set the limit to different values. I have discovered RECORDS.
> This is some example code that gets me thinking that I could use it to
> do my job.
> 
> 10=RECORDS
> 10.source.current=1
> 10.tables = tt_content
> 10.wrap = <parent>|</parent>
> Now this should wrap every content object in parent tag. I thought
> maybee I could use it to do the following:
> 
> If the content element id is n change the limit for the news to m.
> 
> Is this possible? Thank you.
>
Don't think so. This code helps only change the HTML wrap around a content 
element, or you can use it to present different values from the tt_content 
table.

But News aren't saved in the tt_content table. Or to be correct, the instance 
of the plugin (LATEST, LIST, SINGLE ..) are saved in tt_content, but every 
single news are saved in another table (tt_news). I suppose you are using 
tt_news, - if not I can't give any answer. 

As I understand your problem is having to instances of the News plugin on 
the same page, both showing latest. One should present 1 news, the other 
5 news. If these are inserted as content element trough the page module, 
this is quite simple. Look under the tab "Other Setting". The choice Limit, 
gives the answer.

If you are inserting the instances through typoscript the answer is a bit 
different, but the property are latestLimit (or limit in list)

Something like this:

lib.news1 < plugin.tt_news
lib.news1 {
     pid_list = xx
     code = LATEST
     ...... other code
     latesLimit = 1
}

lib.news2 < plugin.tt_news
lib.news2 {
     pid_list = xx
     code = LATEST
     ...... other code
     latesLimit = 5
}

And you will find the all the answer in the tt_news manual. So read it.

Of course it's possible to get the news record direct from the tt_news, but 
that looks for me as a uneccesary complex way.

WBR,
Erik Svendsen
www.linnearad.no





More information about the TYPO3-english mailing list