Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #set ($maxTitleLength = 55)
- #set ($newsItemsPerColumn = 4)
- ############## Categories from widget ##################
- ## Get the categories from the multiselects used when the widget was put into the page,
- ## then format them for use in a query
- #### AUDIENCE
- ## If no audience is specified for the widget, show ALL audiences' stories
- #if($audience.size()>0)
- #set($audienceQuery = "+(")
- #foreach($categoryInode in $audience)
- #set($audienceCat = $categories.getCategoryByInode($categoryInode))
- #set($audienceQuery = "${audienceQuery}categories:${audienceCat.categoryVelocityVarName} ")
- #end
- ## End with a closing parenthesis
- #set($audienceQuery = "$audienceQuery)")
- #end
- #### DEPARTMENT
- ## If no department is specified for the widget, show ALL departments' stories
- #if($officesservicesdepartments.size()>0)
- #set($departmentQuery = "+(")
- #foreach($categoryInode in $officesservicesdepartments)
- #set($departmentCat = $categories.getCategoryByInode($categoryInode))
- #set($departmentQuery = "${departmentQuery}categories:${departmentCat.categoryVelocityVarName} ")
- #end
- #set($departmentQuery = "$departmentQuery)")
- #end
- #### FEATURE LEVEL
- ## If no feature level is specified for the widget, show ALL levels' stories
- #if($onlyFeaturedContentFor.size()>0)
- #set($featureQuery = "+(")
- #foreach($categoryInode in $onlyFeaturedContentFor)
- #set($featureCat = $categories.getCategoryByInode($categoryInode))
- #set($featureQuery = "${featureQuery}categories:${featureCat.categoryVelocityVarName} ")
- #end
- #set($featureQuery = "$featureQuery)")
- #end
- ############## Generate the listing ##################
- #set($ocNewsQuery = "+structureName:OcNews +live:true +working:true $!audienceQuery $!departmentQuery $!featureQuery")
- <!--$!{ocNewsQuery}-->
- <section class="newslist ocnews" data-count="$dotcontent.count($ocNewsQuery)" data-itemspercolumn="$newsItemsPerColumn" data-currentul="1" data-ocnewsquery="$UtilMethods.encodeURL($!ocNewsQuery)">
- <div class="newsboxtitle">
- <h3><a href="/news">$!displayTitle</a></h3>
- <a href="/news/rss-feed.html?title=$!UtilMethods.encodeURL($!displayTitle)&query=$!UtilMethods.encodeURL($!ocNewsQuery)" class="rssbutton" title="OC News RSS Feed">$!displayTitle RSS Feed</a>
- </div>
- <a href="#scrollup" class="scrollup inactive">Newer Stories</a>
- <div class="newslistholder">
- <div class="newslistmover">
- <ul>
- #dotParse("/lucid/ochome/widgets/ocnewsul.vtl")
- </ul>
- </div>
- </div>
- <a href="#scrolldown" class="scrolldown active">Older Stories</a>
- </section>
- ## Reset all variables to not interfere with multiple instances of widget
- #set ($maxTitleLength = "")
- #set ($newsItemsPerColumn = "")
- #set($audienceCat = "")
- #set($audienceQuery = "")
- #set($departmentCat = "")
- #set($departmentQuery = "")
- #set($featureCat = "")
- #set($featureQuery = "")
- #set($ocNewsQuery = "")
Advertisement
Add Comment
Please, Sign In to add comment