University of Vermont

UVM Self-help Web Guide

News and the NewsTool

The NewsTool is designed for developers who wish to add news stories and releases to their website on an ongoing basis and includes the following features:

  • Web interface for adding stories which requires no knowledge of HTML.
  • Ability to delegate adding news stories to your website to any number of users.
  • A publishing workflow that requires you (or designated administrators) to approve stories before publication.
  • E-mail notification when stories are available for publication.
  • Possibility to share stories with other groups using the NewsTool.
  • Ability to easily add images, video and/or audio to news stories.

Access to the tool is granted after a.) attending a training session sponsored by the UVM Web Team or b.) receiving training from any trained news administrator for your website.

Adding news stories to your website

There are several options for adding news stories:

  • As a list of your most recent three stories with a link to a full list in the quick links area
  • As a link to a page with a list of your stories from a menu (or the content area)
  • As a special page using a news template
  • Or, with your own customized code via PHP code snippets
Using the quick links area

In the zero line of your defaultmenu.html add the following, specifying your group abbreviation (set in the groups tab of the NewsTool) for ucommall in the highlighted area:

0 Your Website Title newsbar=ucommall

Or, in your magicoptions.html add the following, specifying your group abbreviation (set in the groups tab of the NewsTool) in the highlighted area:

newsbar ucommall news side bar
As a link from menus

Add the following code to defaultmenu.html or any submenu or Quick Links et al. file specifying your group abbreviation (set in the groups tab of the NewsTool) in the highlighted area:

news&category=ucommall

To create this link in the content area of a page, create a link referring to the news similar to the following example:

?Page=news&category=ucommall

Via the news templates

There are two pre-built design templates available for displaying news stories. To use the template, download the file and update the annotated areas using the code view in your HTML editor.

Template 1 Template 2
News Template 1 News Template 2
download a zipped copy of template 1
(for responsive only)
download a zipped copy of template 2
(for responsive only)
Via PHP Code Snippets

Feeds from news can be included in any .php page on your website and customized as desired. To access the code snippets you'll need to add this piece of PHP code anywhere in the php file before your news call:

 <?php require_once( "{$_SERVER['UVMMAGIC']}/plugins/news/aggregate_driver.php" ); ?>
 

Then add one or more snippets to the page wherever you'd like news to appear:

<?php makeNews( array("category:groupid","numFull:1","numStandard:3","numBasic:10") ); ?>
 

Here are the various options that you can modify for further customization:

Option Default Value Description
category ucommall Group abbreviation for the desired news group (set in the groups tab of the NewsTool)
numFull 0 The number of stories to pull into "full" aggregate form (includes date, title, featured media and synopsis)
numStandard 0 The number of stories to pull into "standard" aggregate form (includes date, title and synopsis)
numBasic 10 The number of stories to pull into "basic" aggregate form (includes date and title)
mediaWidth 320 Pixel width value for the featured images and video in "full" aggregate form
Note: the minimum suggested width for video is 210
startFrom 0 From which story to show stories: most recent story = 0, next = 1, and so on
showCaption 0 Toggle media captions: show = 1, don't show = 0
moreFull 0 Toggle more stories link in "full" form: show = 1, don't show = 0
moreStandard 0 Toggle more stories link in "standard" form: show = 1, don't show = 0
moreBasic 1 Toggle more stories link in "basic" form: show = 1, don't show = 0
fullRSS 0 Toggle RSS feed link in "full" form: show = 1, don't show = 0
standardRSS 0 Toggle RSS feed link in "standard" form: show = 1, don't show = 0
basicRSS 1 Toggle RSS feed link in "basic" form: show = 1, don't show = 0
videoMethod 1 Method for displaying featured videos on the page: play in place = 1, play in light box = 2, link to story = 3
picLink 1 Set link for featured images on the page: links to story = 1, no link = 0
dateFormat 1 Set format for date display: 06/23/1984 = 1, June 23, 1984 = 2
linkBase [current directory] Set stories links to utilize an alternate website rather in the current directory: /~uvmpr/, /academics/, /artsandsciences/

You can add a simple search feature on any PHP page in your site, the search will return results for news stories in one or more categories. Results are displayed on a PHP page of your choosing.

To add news search to your site copy the appropriate code into your news (or other) PHP page where you'd like the search box to appear.

Simple Search

This example adds a simple search in one category and displays the results on the current page.

 <?php 
 	require_once("{$_SERVER['UVMMAGIC']}/plugins/news/news_search.php");
 	addSearch(array("group1"));
 	showSearchResults();
 ?>
 
Extended Search

This example adds a simple search in multiple categories displaying the results on a php page of your choosing.

  1. Create a results page (e.g. search_results.php) -- the results page must have a .php extension. You may format and add content to this page (i.e. add sidebars, headings, etc.)
  2. Include in your results page the following code:
     <?php 
     	require_once("{$_SERVER['UVMMAGIC']}/plugins/news/news_search.php");
     	showSearchResults();
     ?>
     	
  3. Add a search box on any PHP page using the following code replacing the group names and results file name as appropriate:
     <?php 
     	require_once("{$_SERVER['UVMMAGIC']}/plugins/news/news_search.php");
     	addSearch(array("group1","group2","group3"),"?Page=search_results.php");
     ?>
     	

Last modified June 20 2013 10:07 AM