Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
## --------------------------------------------------
## SETTING THE DEFAULT NUMBER OF RESULTS ------------
## --------------------------------------------------
#if (!$UtilMethods.isSet($numberOfResults))
#set($numberOfResults = 20)
#end
## --------------------------------------------------
## SETTING THE SORT ORDER ---------------------------
## --------------------------------------------------
#set ($sortBy = "Article.datePublished desc")
## --------------------------------------------------
## SETTING RELATIONSHIP FILTERS ---------------------
## --------------------------------------------------
#if($UtilMethods.isSet($organization))
#set($organizationRel = '+Organization-Article:')
#set($organizationID = $organization)
#end
#if($UtilMethods.isSet($featuredPerson))
#set($featuredPersonRel = '+Featured-Person:')
#set($featuredPersonID = $featuredPerson)
#end
#if($UtilMethods.isSet($contentLocation))
#set($locationRel = '+Location-Content:')
#set($locationID = $contentLocation)
#end
#if($UtilMethods.isSet($dataset))
#set($datasetRel = '+Dataset-Article:')
#set($datasetID = $dataset)
#end
#if($UtilMethods.isSet($series))
#set($seriesRel = '+Series-Article:')
#set($seriesID = $series)
#end
#if($UtilMethods.isSet($author))
#set($authorRel = '+Author-Article:')
#set($authorID = $author)
#end
## 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($newsListing = $dotcontent.pullPerPage("
+contentType:Article
$!{datasetRel}$!{datasetID}
$!{locationRel}$!{locationID}
$!{organizationRel}$!{organizationID}
$!{authorRel}$!{authorID}
$!{seriesRel}$!{seriesID}
$!{featuredPersonRel}$!{featuredPersonID}
",$!{page}, $!{itemsPerPage},"$!{sortBy}"
#else
#set($newsListing = $dotcontent.pull("
+contentType:Article
$!{datasetRel}$!{datasetID}
$!{locationRel}$!{locationID}
$!{organizationRel}$!{organizationID}
$!{authorRel}$!{authorID}
$!{seriesRel}$!{seriesID}
$!{featuredPersonRel}$!{featuredPersonID}
", $!{numberOfResults},"$!{sortBy}"
<p>Dataset: $datasetRel $datasetID </p>
<p>Place “contentLocation”: $locationRel $locationID</p>
<p>Organization: $organizationRel $organizationID </p>
<p>Person “author”: $authorRel $authorID </p>
<p>Series: $seriesRel $seriesID</p>
<p>Person “featuredPerson”: $featuredPersonRel $featuredPersonID </p>
<section itemscope itemtype="http://schema.org/Article">
#if ($UtilMethods.isSet($headline))
#if (!$UtilMethods.isSet($headlineFontSize))
#set ($headlineFontSize = '1')
#end
<h$!{headlineFontSize}>
#if($UtilMethods.isSet($newsHomepageUrl))
<a href="${newssHomepageUrl}">
#end
$!{headline}
#if($UtilMethods.isSet($newsHomepageUrl))
</a>
#end
</h$!{headlineFontSize}>
#end
#if($newsListing.size() > 0)
<ul class="">
#foreach($news in $newsListing)
<li class="">
#editContentlet($news.inode)
<a itemprop="url" href="$news.urlTitle">
<img itemprop="image" class="" alt="$news.imageDescription" src="">
</a>
<p class="" itemprop="caption">$news.caption</p>
#end
#end
#if($UtilMethods.isSet($headlineType))
##if headline is set this adds 1 from it
#set($nameFontSize = $math.add($!{headlineType}, 1).intValue())
#else
#set($nameFontSize = '2')
#end
<h$!{nameFontSize} itemprop="name"><a itemprop="url" href="$news.urlTitle">$news.title</a></h$!{nameFontSize}>
#if($UtilMethods.isSet($news.datePublished))
<p itemprop="datePublished" class="">$date.format('MMMM d, yyyy', $news.datePublished)
#end
#set($related-authors = $dotcontent.pullRelated("Author-Article","$news.identifier",true,10,"person.lastName asc"))
#if($related-authors.size() > 0)
#foreach($author in $related-authors)
#if($foreach.count==1)
<p itemprop="author" class="">
#end
<a href="$author.urlTitle">$author.givenName $author.familyName</a>#if($foreach.hasNext), #end
#if(!$foreach.hasNext)
</p>
#elseif($news.authorText.length() > 0)
<p itemprop="author" class="">$news.authorText</p>
<p itemprop="description">$news.description</p>
#end
</li>
#end
</ul>
#if($pagination.contains('true') && $newsListing.totalPages > 1)
<ul class="pagination">
#if($newsListing.previousPage)
<li><a href="$!{VTLSERVLET_URI}?page=$!{math.sub($page, 1)}">«</a></li>
#end
#foreach($i in [1..$newsListing.totalPages])
<li #if($page == $velocityCount)class="active"#end><a href="$!{VTLSERVLET_URI}?page=${velocityCount}">$velocityCount</a></li>
#end
#if($newsListing.nextPage)
<li><a href="$!{VTLSERVLET_URI}?page=$!{math.add($page, 1)}">»</a></li>
#end
</ul>
#end
#else
<p>There are no news stories at this time.</p>
#end
</section>