stephenjbell

dotCMS -List of All Structures With Associated Categories

Jul 11th, 2011
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 0.57 KB | None | 0 0
  1. <h1>List of All Structures With Associated Categories</h1>
  2.  
  3. #set($allstructures = $structures.findStructures(true))
  4. <ul>
  5.     #foreach($structure in $allstructures)
  6.     <li>
  7.     <h2>$structure.name</h2>
  8.         <ul>
  9.         #foreach($field in $structure.getFields())
  10.            
  11.             #if($field.fieldType=="category")
  12.             <li>
  13.                 #set($thiscat = $categories.getCategoryByInode($field.values))
  14.                 $thiscat.key
  15.                 <ul>
  16.                 #foreach($subcat in $categories.getChildrenCategories($thiscat))
  17.                     <li>$subcat.key</li>
  18.                 #end
  19.                 </ul>
  20.             </li>
  21.             #end
  22.            
  23.         #end
  24.         </ul>
  25.    
  26.     </li>
  27.     #end
  28. </ul>
Advertisement
Add Comment
Please, Sign In to add comment