stephenjbell

Combine and sort two pulls - dotCMS

Jun 15th, 2012
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.59 KB | None | 0 0
  1. ## Pull two different structures in dotCMS, then merge together and sort (must have variables with same name, like "title")
  2.  
  3. #set($facilities = $dotcontent.pull("+structureName:Facility1  +Facility1.availableFor:* ",0,"Facility1.title"))
  4. #set($buildings = $dotcontent.pull("+structureName:Building1  +Building1.availableFor:* ",0,"Building1.title"))
  5.  
  6. #set($rentals = $facilities)
  7. #set($_dummy = $rentals.addAll($buildings))
  8.  
  9. #set($rentals = $sorter.sort($rentals, "title"))
  10.  
  11. <ul>
  12.     #foreach($rental in $rentals)
  13.         <li>
  14.             <a href="$rental.getUrlMap()">$rental.title</a>
  15.         </li>
  16.     #end
  17. </ul>
Advertisement
Add Comment
Please, Sign In to add comment