Presentation is loading. Please wait.

Presentation is loading. Please wait.

Server-side includes Library and Information Services University of St Andrews.

Similar presentations


Presentation on theme: "Server-side includes Library and Information Services University of St Andrews."— Presentation transcript:

1 Server-side includes Library and Information Services University of St Andrews

2 What are server-side includes (SSI)? Mechanism of employing the web server to perform certain tasks displaying files as part of other files displaying information dynamically (dates, URLs) Server support needed

3 File extensions:.html .shtml Files containing SSI are html files Server only parses files with extension.shtml for SSI Rename/save any files that contain SSI directives as.shtml

4 SSI directives Code inserted into html source of a document Syntax: Various elements (e.g. “include”, “echo”, “config”) and attributes to go with these elements

5 SSI elements: include Syntax: Inserts a file into another file Including file: file that contains the SSI directive Included file: file that is displayed as part of another file

6 Including and included files SSI demo SSI demo Some text … some more text … School of Pottery University of St Andrews St Andrews Fife KY16 9AJ andrews.ac.uk Including fileIncluded file

7 Including and included file SSI demo SSI demo Some text … School of Pottery University of St Andrews St Andrews Fife KY16 9AJ some more text …

8 SSI elements: echo Displaying URLs dynamically Syntax: Displaying last modified date dynamically Sxntax: Displaying date and time dynamically Syntax:

9 SSI elements: config Configure current and last modified time stamps Syntax: Directive appears immediately in front directive for time stamp will display e.g. Wednesday, 12 November 2003

10 Timefmt: values Server dependent Some values that can be used in St Andrews: %aAbbreviated day name %AFull day name %dDay as number (1-31) %bAbbreviated month name %BFull month name %mMonth as number (1-12) %HHour as number (24-hour clock) %IHour as number (12-hour clock) %MMinute as number (00-59) %SSecond as number (00-59) %YYear

11 Why use SSI? For templates: to ensure consistent layout Content management on institutional web sites Control privileges of various web masters Avoiding unnecessary duplication of repetitive content Ease of updating Time management


Download ppt "Server-side includes Library and Information Services University of St Andrews."

Similar presentations


Ads by Google