More About the Website

WordPress and LAMP

The purpose of this section is to act as an aide-memoire to your forgetful webmaster and to satisfy the curiosity of anyone who would like to know more about how our website works.

The HRSC website is constructed using WordPress, an Open Source publishing platform that relies upon a scripting language called PHP and uses a MySQL database.  The site is hosted at 1and1.co.uk on a Linux platform with an Apache server.  This combination of Linux, Apache, MySQL and PHP, often referred to as LAMP, is the preferred choice of web developers who prefer to keep out of the clutches of Microsoft and use Open Source, and therefore free, solutions.

WordPress is primarily a blogging system but it can be quite readily adapted to content management by using an appropriately constructed theme and some well chosen plugins. The WordPress theme system allows a developer to create custom page templates and stylesheets that determine how the site operates and how it looks, all without modifying the core of the system.  Our theme is called Racing Trim.

The Racing Trim theme was developed specially for HRSC.  It includes a number of custom templates and relies on a handful of helpful plugins.

Pages, Posts and Categories

WordPress makes a distinction between pages, which are intended for the relatively static parts of a website, and posts, which are often dated and intended for news items. Posts must be assigned to a category and are usually listed in reverse date order with the most recently filed posts at the top. On our site this distinction is blurred as we have some pages, such as the home page, which combine static content with excerpts from recent posts in some categories. Pages and sub-pages are shown in the two level menu bar at the top of the site, but using a special template called Page Redirect some of those pages link directly to individual categories to show posts in that category.

Templates, Sidebars and Widgets

Posts are all formatted using a default template, which on our site consists of a single wide content area with a narrow sidebar to the right. The default template for pages is the same, but we have added several more complex templates such as the one used on the home page. The page you’re viewing now uses the default template. In some cases what appears in the sidebar is determined by special code in the template, in others, such as the default template, by code blocks called widgets that are inserted from a widget control panel available to the website administrator. A useful plug-in called Widget Logic allows the administrator to determine which pages individual widgets appear on.

Home Page

Our Home page uses a custom template made up of three columns; a wide content area and two sidebars.  A plugin called Wordcycle, which is a wrapper for the jQuery Cycle plugin, provides the image slideshow.

The inner sidebar shows excerpts from recent posts from Club News, Yacht NewsDinghy News and Junior News. This is achieved with special code  added to the Home Page template. See how this is done.  The RS Events Multiday plugin is used to show upcoming events in the outer sidebar.

Club Page

The Club page has a number of sub-pages. The first of these, Club News, is redirected to the Club News category using the Page Redirect template. The Club News category shows the full content of the latest six posts in Club News together with sidebar links to all the posts in the category.  These sidebar links are shown using a plugin by Robert Felty called Collapsing Categories.  The remainder of the Club House sub-pages are straightforward although some contain tables which are provided by another plugin: WP-Table Reloaded.

Sailing Pages

The pages for the three main sailing sections at HRSC have a similar format.  Taking the Yachts section as an example, the top menubar link goes straight to the Yacht News category.  What actually happens is that the main Yachts page uses a special page template to redirect the page to its first child. In this case, the first child page, called Yacht News, is also redirected using another template to the Yacht News category. The other two sailing sections, Dinghy News and Junior News, work in exactly the same way.

These category pages show the full content of the last six posts in the category or any of its sub-categories. The sidebar list, provided by the Collapsing Categories plugin, shows the category with each of  its sub-categories below and expands to show links to all of the posts in each of the sub-categories.

Each of the main sailing section pages, Yachts, Dinghies and Juniors, has a number of straightforward sub-pages. Some, L’Aber-Wra’ch for example, link through to the category of the same name.

When a page has grandchildren these are shown in the sidebar. This is achieved automatically with special code that is added to the default template to detect when a page is a grandchild and list its siblings. See how this is done.