About Features Downloads Getting Started Documentation Events Support GitHub

Site Tools


Static Pages

:!: This feature was introduced in VuFind 4.0

It is sometimes useful to host mostly-static HTML pages within the framework of VuFind itself. The system provides a simple mechanism for serving arbitrary templates, including internationalization support.

Simple Example

For static content, simply create a new template inside the templates/content folder of your theme. You can then link to this content using the content-page route with the template name passed to the route as the 'page' parameter.

VuFind ships with an example FAQ template showing how to set up this simple scenario. The link to this page is:

<a href="<?=$this->url('content-page', ['page' => 'faq']) ?>"><?=$this->transEsc('FAQs')?></a>

It is also possible to display a content page in a lightbox by adding the data-lightbox attribute to the link:

<a href="<?=$this->url('content-page', ['page' => 'faq']) ?>" data-lightbox><?=$this->transEsc('FAQs')?></a>

Multi-language Example

The content system also supports i18n. If you create different versions of a template with filenames suffixed with a language code (e.g. faq_en.phtml, faq_de.phtml, etc.) VuFind will attempt to load the version matching the user's selected language. If no match is found, it will next attempt to load the template matching the configured default language. If that is not found, it will finally default to the non-suffixed version of the filename.

For an example, see the asklibrary.phtml and asklibrary_en.phtml templates in the content template folder.

configuration/static_pages.txt · Last modified: 2016/11/02 03:13 by emaijala