Web Templates

A template has been created that allows Faculty and Staff with web pages underneath http://www.physics.byu.edu/ to use the look and feel of the Physics and Astronomy web site. The template is available in an ASP.NET version and a PHP version. 

Asp.Net Template

To use the ASP.NET version of the template, put the following line of code in an otherwise standard html file

<%@ Page Inherits="WebTemplate.Template" %>

and save the page with the extension .aspx instead of .html.  Thus, for each page you want to use the template, your file would look something like this (when viewed from a text editor):

<%@ Page Inherits="WebTemplate.Template" %>
<html>
  <head>
    <title>Title of the Page</title>
  </head>
  <body>
	
  </body>	
</html>

PHP Template

To use the PHP version of the template, put the following line of code in an otherwise standard html file

<?php require 'WebTemplate.php' ?>

and save the page with the extension .php instead of .html.  Thus, for each page you want to use the template, your file would look something like this (when viewed from a text editor):

<?php require 'WebTemplate.php' ?>
<html>
  <head>
    <title>Title of the Page</title>
  </head>
  <body>
	
  </body>	
</html>

Navigation Menu

Both the ASP.NET and PHP templates use a plain text file called NavMenu.txt to generate a dropdown menu at the top of the page and a navigation menu on the left of the page. In this file, each line is an entry in the menu. A line that starts with a greater than sign (>) starts a new tab in the menu.  Any line without an equals sign (=) is a header for a group of links, and any line with an equal sign will become a link. The text of the link is before the = and the URL is the text after the =. For example, a simple navigation menu with two headers and four page links would look like this:

>Title of Menu Tab
My Header
My First Page=FirstPage.aspx
My Second Page=SecondPage.php

Another Header
My Third Page=ThirdPage.aspx
My Fourth Page=FourthPage.php

>Another Menu Tab
More Headers
And More Links=AnotherPage.aspx

Blank lines are ignored.  While you can mix aspx and php pages if you like, it would probably be best to choose one flavor or the other.

Widgets

On any page on the department server, you may use a series of "Widget" tags to dynamically place content from the department database into your page.  The template pages are already set up to use widgets, so all you need to do is enter one or more div tags of the following form:

<div class="widget" data-arguments="type:[typeValue];[argument1]:[value1];[argument2]:[value2];" ></div>

where the values in square brackets change according to the type of widget you want.  The class name widget is reserved for this purpose, so don't use that class name for styling.  The type part of the data-arguments attribute is always required to tell the widget system what kind of code to make.  The optional arguments may or may not be required depending on the widget.

Research Projects

Faculty members enter research projects using the web interface under Faculty - Research Projects on the main department menu.  The entire list of research projects is publicly listed at Research - Research Projects.  To display the entire list of projects on a website that you control,  use the following widget:

<div class="widget" data-arguments="type:projects;" ></div>

To display the research projects for a specific research area, use the following widget:

<div class="widget" data-arguments="type:projects;area:[areaName]" ></div>

where [areaName] can take on one of the following values: acoustics, astronomy, amo, condensed, plasma, or theory. 

To display the research projects for a specific research area, use the following widget:

<div class="widget" data-arguments="type:projects;person:[nameId]" ></div>

where [nameId] is the unique name id assigned to a faculty member.  Usually the name id is just their last name, but in cases where we have duplicate last names, their first initial is appended.  You can look up the name id on the department directory by clicking on people and looking at the last part of the url..

Multiple Name Ids

The following widgets will allow faculty to display content which is associated with one or more users.  You can fetch content associated with more than one faculty member by inputting a dash-separated list of nameIds when prompted for a nameId.  Again, a list of nameIds entails entering one or more nameIds in a dash separated list as in the following example:

<div class="widget" data-arguments="type:publicationslider;nameid:baggins-gamgee;" ></div>

This code would fetch any publication features associated with 'baggins', as well as any associated with 'gamgee', and place them in a slider similar to the one you can view on the physics home page.

Publication Sliders

To display publication features in a feature slider, use:

<div class="widget" data-arguments="type:publicationslider;nameid:[nameIdList];" ></div>

At least one nameId is required. Optionally however, you may specify a begin year, or a begin year and an end year:

<div class="widget" data-arguments="type:publicationslider;nameid:[nameIdList];beginyear:[beginYear];endyear:[endYear];" ></div>

The begin year and the end year provide the year range of the publications you want to include (an inclusive range). The begin year can be either hardcoded (e.g. 2013) or measured relative to the current year using the syntax "Y-0" for only the current year, "Y-1" for the current year and the previous year, "Y-2" for the current year and the past two years, etc.  (The quotation marks are not part of the year string.)

Publications

To display a list of publications like those found on the department publication list, use this syntax :

<div class="widget" data-arguments="type:publications;nameid:[nameIdList];" ></div>

At least one nameId is required. Optionally, you may specify a begin year, or a begin year and an end year:

<div class="widget" data-arguments="type:publications;nameid:[nameIdList];beginyear:[beginYear];endyear:[endYear];" ></div>

The begin year and the end year provide the year range of the publications you want to include (an inclusive range).  The begin year can be either hardcoded (e.g. 2013) or measured relative to the current year using the syntax "Y-0" for only the current year, "Y-1" for the current year and the previous year, "Y-2" for the current year and the past two years, etc.  (The quotation marks are not part of the year string.)

Feature sliders

To display features in a feature slider, similar to the department home page, use this syntax:

<div class="widget" data-arguments="type:features;nameid:[nameIdList];" ></div>

At least one nameId is required.

Directory Listings

To display complete directory listings for faculty members:

<div class="widget" data-arguments="type:directorylistings;nameid:[nameIdList];" ></div>

At least one nameId is required.

Contact Info

To display contact info for faculty members:

<div class="widget" data-arguments="type:contacts;nameid:[nameIdList];" ></div>

At least one nameId is required.

Schedule Info

To display schedule info for faculty members:

<div class="widget" data-arguments="type:schedules;nameid:[nameIdList];" ></div>

At least one nameId is required.

Bio Info

To display bio info for faculty members:

<div class="widget" data-arguments="type:bios;nameid:[nameIdList];" ></div>

At least one nameId is required.

Research Overview

To display research overviews for faculty members:

<div class="widget" data-arguments="type:researchoverviews;nameid:[nameIdList];" ></div>

At least one nameId is required.