Using Web Tools Phoenix PHP templates

From Eclipsepedia

Revision as of 17:47, 6 February 2007 by Bob.fraser22.gmail.com (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

Introduction

To generate content for the existing Web Tools Web site, content is placed in XML files, an Ant build script is invoked which applies an XSL transformation and an HTML file is generated. In Phoenix, a PHP file is invoked which loads the same XML file and applies a (different) XML transformation and the HTML content is dynamically generated.

A few templates have been provided to simplify conversion of content from the existing (blue) look and feel to the new Phoenix (purple) look and feel.

Getting started

Templates

Templates have been provided for a couple of the common document styles. These can be found in /webtools/phoenix/.

XHTML style documents

These are simple xhtml documents without formatting elements. To convert to Phoenix:

  • Copy /webtools/phoenix/main.php to your directory. Change the name as appropriate to match the XML content you are serving up. (eg. bug.php for bugs.xml)
  • Edit the line $xml = DOMDocument::load('main.xml'); to point to the right name of the XML file
  • Change the $pageAuthor variable to your name
  • Optionally set the $pageKeywords variable to add search keywords.
  • Invoke the PHP file and test your page

Use the following HTML elements to control the document:

  • The <title> element will be used to set the page title
  • The first <h1> will be used to provide a page header with a logo and the page title as a subheading
  • <h2> will give you a purple bar as a section separator


An example XML file can be found here

http://www.eclipse.org/webtools/phoenix/main.xml

You may have to right click, download the file and edit it to see it as XML.

The resulting page can be viewed at:

http://www.eclipse.org/webtools/phoenix/main.php

<section> style documents

These documents use <section>, <infobox> and <item> elements. To convert to Phoenix:

  • Copy /webtools/phoenix/page.php to your directory. Change the name as appropriate to match the XML content you are serving up. (eg. home.php for home.xml)
  • Edit the line $xml = DOMDocument::load('main.xml'); to point to the right name of the XML file
  • Change the $pageAuthor variable to your name
  • Optionally set the $pageKeywords variable to add search keywords.
  • Invoke the PHP file and test your page

Use the following XML elements to control the document:

  • [TBD add doc on the elements used] For now look at the before and after pages below.

An example XML file can be found here

http://www.eclipse.org/webtools/phoenix/page.xml

You may have to right click, download the file and edit it to see it as XML.

The resulting page can be viewed at:

http://www.eclipse.org/webtools/phoenix/page.php