## -------------------------------------------------- ## SETTING THE DEFAULT NUMBER OF RESULTS ------------ ## -------------------------------------------------- #if (!$UtilMethods.isSet($numberOfResults)) #set($numberOfResults = 5) #end ## -------------------------------------------------- ## SETTING THE SORT ORDER --------------------------- ## -------------------------------------------------- #set ($sortBy = "modDate desc") #if ($sortResultsBy == "Name") #set ($sortBy = "Employee.lastName $sortOrder1") #elseif ($sortResultsBy == "date") #set ($sortBy = "modDate $sortOrder1") #end ## -------------------------------------------------- ## FILTER BY CATEGORIES ----------------------------- ## -------------------------------------------------- #set($catsQuery = "") #foreach ($catInode in $topic) #if ($velocityCount == 1) #set($catsQuery = "categories:$categories.getCategoryByInode($catInode).categoryVelocityVarName") #else #set($catsQuery = "$catsQuery categories:$categories.getCategoryByInode($catInode).categoryVelocityVarName") #end #end #if ($UtilMethods.isSet($catsQuery)) #set($catsQuery = "+($catsQuery)") #end #set($ignoreQuery="") #if($UtilMethods.isSet($URLMapContent.inode)) #set($ignoreQuery="-inode:$URLMapContent.inode") #end ## -------------------------------------------------- ## FILTERS BY TAGS ---------------------------------- ## -------------------------------------------------- #set($tagsQuery = "") #if ($UtilMethods.isSet($tagsFilter)) #foreach ($tag in $tagsFilter.split(',')) #if ($velocityCount == 1) #set($tagsQuery = "+Employee.tags:$tag") #else #set($tagsQuery = "$tag +Employee.tags:$tag") #end #end #end ## -------------------------------------------------- ## SETTING PAGINATED RESULTS ------------------------ ## -------------------------------------------------- #if($pagination.contains('true')) ## SETTING ITEMS PER PAGE #if ($UtilMethods.isSet($itemsPerPage)) #set($itemsPerPage = $webapi.parseInt($itemsPerPage)) #else #set($itemsPerPage = 5) #end ## GETTING PAGE NUMBER #if($UtilMethods.isSet($request.getParameter('page'))) #set($page = $webapi.parseInt($request.getParameter('page'))) #else #set($page = 1) #end #end #if($pagination.contains('true')) #set($employeesListing = $dotcontent.pullPerPage("+structureName:Employee +(conhost:$host.identifier) $!{catsQuery} $!{tagsQuery} ${ignoreQuery}",$math.toInteger(${page}),$math.toInteger(${itemsPerPage}),"$!{sortBy}")) #else #set($employeesListing = $dotcontent.pull("+structureName:Employee +(conhost:$host.identifier) $!{catsQuery} $!{tagsQuery} ${ignoreQuery}",$math.toInteger(${numberOfResults}),"$!{sortBy}")) #end #if ($UtilMethods.isSet($headline)) #if (!$UtilMethods.isSet($headlineType)) #set ($headlineType = '1') #end <h$!{headlineType} class="employees-listing-headline">$!{headline}</h$!{headlineType}> #end #if($employeesListing.size() > 0) <ul class="employees-list faculty"> #foreach ($employeesItem in $employeesListing) <li class="employees-item faculty-person"> #editContentlet($employeesItem.inode) <p class="name"> #if ($fieldsToDisplay.contains('image') && $UtilMethods.isSet($employeesItem.photo.rawUri)) <a href="$!{folderUrl}/$!{employeesItem.urlTitle}"> <img class="employees-image faculty-thumb" src="/contentAsset/image/$!{employeesItem.identifier}/photo/filter/Resize/resize_w/100" alt="$employeesItem.firstName $employeesItem.lastName"> </a> #end <a href="$!{folderUrl}/$!{employeesItem.urlTitle}">$employeesItem.firstName $employeesItem.lastName</a> #if($fieldsToDisplay.contains('position') && $UtilMethods.isSet($employeesItem.position)) <br><span class="position">$employeesItem.position</span> #end </p> #if ($fieldsToDisplay.contains('summary') && $UtilMethods.isSet($employeesItem.summary)) <p class="summary">$!{employeesItem.summary}</p> #end </li> #end </ul> #if($pagination.contains('true') && $employeesListing.totalPages > 1) <ul class="pagination"> #if($employeesListing.previousPage) <li><a href="$!{folderUrl}/?page=$!{math.sub($page, 1)}">«</a></li> #end #foreach($i in [1..$employeesListing.totalPages]) <li #if($page == $velocityCount)class="active"#end><a href="$!{folderUrl}/?page=${velocityCount}">$velocityCount</a></li> #end #if($employeesListing.nextPage) <li><a href="$!{folderUrl}/?page=$!{math.add($page, 1)}">»</a></li> #end </ul> #end #else <p>There are no employees stories at this time.</p> #end