Skip to content
Snippets Groups Projects
Commit 5a7542fa authored by Brad's avatar Brad
Browse files

Common Content Person Widget initial commit

parent ec5b03f4
No related branches found
No related tags found
No related merge requests found
## --------------------------------------------------
## SETTING THE DEFAULT NUMBER OF RESULTS ------------
## --------------------------------------------------
#if (!$UtilMethods.isSet($numberOfResults))
#set($numberOfResults = 20)
#end
## --------------------------------------------------
## SETTING THE SORT ORDER ---------------------------
## --------------------------------------------------
#set ($sortBy = "Person.familyName asc")
## --------------------------------------------------
## SETTING RELATIONSHIP FILTERS ---------------------
## --------------------------------------------------
#if($UtilMethods.isSet($worksFor))
#set($worksForRel = '+Works-For:')
#set($worksForID = '$worksFor')
#end
#if($UtilMethods.isSet($memberOf))
#set($memberOfRel = '+Member-Of:')
#set($memberOfID = '$memberOf')
#end
#if($UtilMethods.isSet($workLocation))
#set($workLocationRel = '+Work-Location:')
#set($workLocationID = 'workLocation')
#end
#if($UtilMethods.isSet($dataset))
#set($datasetRel = '+Dataset-Person:')
#set($datasetID = 'dataset')
#end
## --------------------------------------------------
## SETTING CATEGORIES -------------------------------
## --------------------------------------------------
#if($UtilMethods.isSet($personType))
#set($cat = "+categories:$!{personType}")
#end
#if($pagination.contains('true'))
## SETTING ITEMS PER PAGE
#if ($UtilMethods.isSet($itemsPerPage))
#set($itemsPerPage = $webapi.parseInt($itemsPerPage))
#else
#set($itemsPerPage = 20)
#end
## GETTING PAGE NUMBER
#if($UtilMethods.isSet($request.getParameter('page')))
#set($page = $webapi.parseInt($request.getParameter('page')))
#else
#set($page = 1)
#end
#set($personListing = $dotcontent.pullPerPage("
+contentType:Person
+(conhost:$host.identifier)
$!{worksForRel}$!{worksForID}
$!{memberOfRel}$!{memberOfID}
$!{workLocationRel}$!{workLocationID}
$!{datasetRel}$!{datasetID}
$!{cat}
", $!{page}, $!{itemsPerPage},"$!{sortBy}"))
#else
#set($personListing = $dotcontent.pull("
+contentType:Person
+conhost:$host.identifier)
$!{worksForRel}$!{worksForID}
$!{memberOfRel}$!{memberOfID}
$!{workLocationRel}$!{workLocationID}
$!{datasetRel}$!{datasetID}
$!{cat}
", $!{numberOfResults}, "$!{sortBy}"))
#end
<section itemscope itemtype="http://schema.org/Person">
#if($UtilMethods.isSet($headline))
#if (!$UtilMethods.isSet($headlineFontSize))
#set ($headlineFontSize = '1')
#end
<h$!{headlineFontSize} itemprop="name">$!{headline}</h$!{headlineFontSize}>
#end
#if($personListing.size() > 0)
<ul class="">
#foreach($person in $personListing)
<li class="">
#editContentlet($person.inode)
#if($UtilMethods.isSet(${person.image}))
<a class="" href="${person.urlTitle}">
<img class="" src="/contentAsset/image/$!{person.image.identifier}/fileAsset/filter/Resize/resize_w/150" alt="$person.givenName $person.familyName">
</a>
#end
#if($UtilMethods.isSet($headlineFontSize))
##if headline is set this subtracts 1 from it
#set($nameFontSize = $math.sub($!{headlineFontSize}, 1).intValue())
#else
#set($nameFontSize = '2')
#end
<h$!{nameFontSize}><a href="${person.urlTitle}" itemprop="name">$person.givenName $person.familyName</a></h$!{nameFontSize}>
#if($UtilMethods.isSet($person.jobTitle))
<p class="title" itemprop="jobTitle">$person.jobTitle</p>
#end
#if($UtilMethods.isSet($person.email))
<p class="email"><a itemprop="email" href="mailto:${person.email}">${person.email}</a></p>
#end
#if($UtilMethods.isSet($person.telephone))
<p class="phone" itemprop="telephone">$person.telephone</p>
#end
</li>
#end
</ul>
#if($pagination.contains('true') && $personListing.totalPages > 1)
<ul class="pagination">
#if($personListing.previousPage)
<li><a href="$!{folderUrl}/?page=$!{math.sub($page, 1)}">&laquo;</a></li>
#end
#foreach($i in [1..$personListing.totalPages])
<li #if($page == $velocityCount)class="active"#end><a href="$!{folderUrl}/?page=${velocityCount}">$velocityCount</a></li>
#end
#if($personListing.nextPage)
<li><a href="$!{folderUrl}/?page=$!{math.add($page, 1)}">&raquo;</a></li>
#end
</ul>
#end
#else
## insert category name, maybe make a default to staff if no categories checked...
<p>There are no $!{categories} listed at this time.</p>
#end
</section>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment