[TYPO3] Changing the rendering of a single content element
ben van 't ende [netcreators]
ben at netcreators.com
Mon Oct 23 21:59:51 CEST 2006
Erik Svendsen wrote:
> 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.
Hey,
I just did something similar recently:
#Frame-02=======================================
### News item1 in right column
frame-02 < plugin.tt_news
frame-02 {
code >
code = LIST
catImageMode = 0
catTextMode = 0
singlePid >
singlePid = 166
categoryMode = 1
categorySelection = 2
listStartId = 0
limit = 1
noPageBrowser = 1
}
#Frame-03=======================================
### News item2 in right column
frame-03 < plugin.tt_news
frame-03 {
code >
code = LIST
catImageMode = 0
catTextMode = 0
singlePid >
singlePid = 166
categoryMode = 1
categorySelection = 2
listStartId = 1
limit = 1
noPageBrowser = 1
}
You can even select a different template for each object.
"templateFile = /fileadmin/tmpl/anothernewslayout.tmpl"
for example.
HTH succes!
ben
--
netcreators :: creation and innovation
www.netcreators.com - www.typo3.nl
More information about the TYPO3-english
mailing list