CSS class "new", "firstnew" and "lastnew" for TypoScript HMENU/TMENU with "newUntil" field enabled


/ Published in: TYPO3
Save to your folder(s)



Copy this code and paste it in your HTML
  1. # ==============================================================================
  2. # Main menu (first level) - Left side navigation
  3. # ==============================================================================
  4. # first level, e.g. tabs
  5. lib.mainnavi = HMENU
  6. lib.mainnavi.entryLevel = 1
  7. lib.mainnavi {
  8. 1 = TMENU
  9. 1 {
  10. wrap = <ul>|</ul>
  11.  
  12. NO = 1
  13. NO {
  14. allStdWrap.insertData = 1
  15. ATagTitle.field = description // subtitle // title
  16.  
  17. stdWrap.cObject = COA
  18. stdWrap.cObject {
  19. 10 = TEXT
  20. 10.field = subtitle // title
  21.  
  22. # Get the unix timestamp from newUntil w/o time and add 23:59:59
  23. 15 {
  24. today {
  25. cObject = TEXT
  26. cObject {
  27. data = field:newUntil
  28. wrap = |+86399
  29. }
  30.  
  31. prioriCalc = intval
  32. }
  33. }
  34.  
  35. 20 {
  36. new.cObject = TEXT
  37. new.cObject {
  38. value = new
  39. wrap = class="|"
  40. if {
  41. value.data = date: U
  42. isLessThan.data = register:today
  43. negate = 1
  44. }
  45. }
  46. }
  47.  
  48. 30 {
  49. firstnew < lib.mainnavi.1.NO.stdWrap.cObject.20.new
  50. firstnew.cObject.value = firstnew
  51. }
  52.  
  53. 40 {
  54. lastnew < lib.mainnavi.1.NO.stdWrap.cObject.20.new
  55. lastnew.cObject.value = lastnew
  56. }
  57. }
  58.  
  59. allWrap = <li {register:firstnew}> |*| <li {register:new}> |*| <li {register:lastnew}>|</li>
  60. }
  61.  
  62. ACT < .NO
  63. ACT = 1
  64. ACT {
  65. ATagParams = class="active"
  66. }
  67.  
  68. wrapItemAndSub = <li> | </li>
  69. allWrap = <strong> | </strong>
  70. linkWrap = |
  71. ATagBeforeWrap = 0
  72. ATagParams = class="active"
  73. }
  74. }
  75.  
  76. 2 < .1
  77. 3 < .1
  78. 4 < .1
  79. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.