Posted By

stwsimon on 07/01/11


Tagged

typoscript query typo3


Versions (?)

Typoscript get random data from a table


 / Published in: TYPO3
 

Gets random data from a table. Modify as required.

  1. lib.randomArticles = CONTENT
  2. lib.randomArticles {
  3. wrap = <div class="rand-articles">|</div>
  4. table = tx_articledatabase_articles
  5.  
  6. select {
  7. pidInList = 97
  8. orderBy = rand()
  9. max = 3
  10. }
  11. renderObj >
  12. renderObj = COA_INT
  13. renderObj {
  14. 10 = TEXT
  15. 10.field = title
  16. 10.wrap = <h4>|</h4>
  17. 20 = TEXT
  18. 20.field = description
  19. 20.wrap=<p>|</p>
  20. 20.typolink.parameter = 97
  21. 20.typolink.additionalParams.field=uid
  22. 20.typolink.additionalParams.wrap = &tx_articledatabase_pi1[showUid]=|
  23. 20.crop = 150|...|1
  24. }
  25.  
  26. }

Report this snippet  

You need to login to post a comment.