Skip to content
Snippets Groups Projects
Commit 1e2bf65f authored by Brad's avatar Brad
Browse files

widget build

parent 7dcd4cfa
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 = "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
## news pull
#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($newsListing = $dotcontent.pullPerPage("
+contentType:Article
## page variable
$!{relationship}$!{content.identifier}
",$!{page},10,"modDate desc"
$!{datasetRel}$!{datasetID}
$!{locationRel}$!{locationID}
$!{organizationRel}$!{organizationID}
$!{authorRel}$!{authorID}
$!{seriesRel}$!{seriesID}
$!{featuredPersonRel}$!{featuredPersonID}
",$!{page}, $!{itemsPerPage},"$!{sortBy}"
))
#else
#set($newsListing = $dotcontent.pull("
+contentType:Article
## page variable
$!{relationship}$!{content.identifier}
",$!{page},10,"modDate desc"
$!{datasetRel}$!{datasetID}
$!{locationRel}$!{locationID}
$!{organizationRel}$!{organizationID}
$!{authorRel}$!{authorID}
$!{seriesRel}$!{seriesID}
$!{featuredPersonRel}$!{featuredPersonID}
", $!{numberOfResults},"$!{sortBy}"
))
#end
<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))
......@@ -36,48 +107,43 @@
#foreach($news in $newsListing)
<li class="">
#editContentlet($news.inode)
#if($fieldsToDisplay.contains('image') && $UtilMethods.isSet($news.image))
#if($UtilMethods.isSet($news.image))
<a itemprop="url" href="$news.urlTitle">
<img itemprop="image" class="" alt="$news.imageDescription" src="">
</a>
#if($fieldsToDisplay.contains('imageCaption') && $UtilMethods.isSet($news.caption))
#if($UtilMethods.isSet($news.caption))
<p class="" itemprop="caption">$news.caption</p>
#end
#end
#set($newsTitleSize = $headlineFontSize - 1)
<h$!{newsTitleSize} itemprop="name"><a itemprop="url" href="$news.urlTitle">$news.title</a></h$!{newsTitleSize}>
#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($fieldsToDisplay.contains('date'))
#if($UtilMethods.isSet($news.publishDate))
<p itemprop="datePublished" class="">$date.format('MMMM d, yyyy', $news.publishDate)
#else
<p itemprop="dateModified" class="">$date.format('MMMM d, yyyy', $news.modDate)</p>
#end
#if($UtilMethods.isSet($news.datePublished))
<p itemprop="datePublished" class="">$date.format('MMMM d, yyyy', $news.datePublished)
#end
###########
## author
###########
#if($fieldsToDisplay.contains('author'))
#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>
#end
#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>
#end
#elseif($news.authorText.length() > 0)
<p itemprop="author" class="">$news.authorText</p>
#end
#elseif($news.authorText.length() > 0)
<p itemprop="author" class="">$news.authorText</p>
#end
#if($fieldsToDisplay.contains('summary') && $UtilMethods.isSet($news.description))
#if($UtilMethods.isSet($news.description))
<p itemprop="description">$news.description</p>
#end
</li>
......
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