[TYPO3] Random content with limited text

Peter Klein peter at umloud.dk
Thu Feb 28 15:06:07 CET 2008


Hi Eric.
Do it using TypoScript. That way you have full control over what is 
displayed.

Example:
-- cut --
lib.randomContent = COA_INTlib.randomContent {  10 = CONTENT  10 {    table 
= tt_content    select {      # ID of the page where your content elements 
are stored      pidInList = 30      # Number of content elements to show 
max = 2      orderBy = rand()    }    renderObj = COA    renderObj {      10 
= TEXT      10.field = bodytext      10.crop = 200 | ... | 1 
10.parseFunc = < lib.parseFunc_RTE    }  }}-- cut --
-- 
Peter Klein/Umloud Untd

"Eric Thelander" <3d-telis at home.se> skrev i en meddelelse 
news:mailman.3734.1204190166.5943.typo3-english at lists.netfielders.de...
> Hello
>
> I want to place a random content on one page, this content is text w/ 
> image. I have set up the page tree as follows
>
> Page 1 (showing random content)
>    -> Page 2 (containing all text w/ image elements )
>
> Right now Page 1 shows a random content fetched from Page 2 using the 
> plugin "Random content". Due to the fact that some of the content on Page 
> 2 contains allot of text I would like to limit it to 255 digits on Page 1, 
> still showing the image. The user will be presented with a "Read more" 
> link to view the complete text.
>
> Any pointer on how I should acomplish this? Is it possible to do that 
> using the "Random content" plaugin?
>
> Best regards
> Eric 




More information about the TYPO3-english mailing list