About Features Downloads Getting Started Documentation Events Support GitHub

Love VuFind®? Consider becoming a financial supporter. Your support helps build a better VuFind®!

Site Tools


Warning: This page has not been updated in over over a year and may be outdated or deprecated.
configuration:static_pages

This is an old revision of the document!


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>

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.1478028684.txt.gz · Last modified: 2016/11/01 19:31 by demiankatz