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.
development:architecture:customizing_vufind

Customizing VuFind

Nearly every aspect of VuFind 2.x and later can be changed. However, because different types of changes require different strategies, there are three main areas where changes can be easily made.

Configuration Files

Much of VuFind's functionality can be controlled through simple .ini files. These are designed to be human-readable and easily changed with little or no programming knowledge.

Default configurations can be found in the /config/vufind subdirectory of VuFind. These can be overridden by copies in the /config/vufind subdirectory of your local settings directory.

Most settings are found in config.ini, but additional files are provided for certain subsystems.

Themes

All of VuFind's HTML pages are generated with the help of templates found in one of its themes. You can extend an existing theme to override some or all of the display templates.

Existing themes are found in the /themes subdirectory of VuFind.

Details on creating a new theme can be found on the Customizing the User Interface page.

You can configure VuFind to use a custom theme through settings in config.ini.

Modules

VuFind is built as a Laminas module. All of its routes and services are configured in /module/VuFind/config/module.config.php.

You can override these settings by building your own custom module. VuFind's install script (php $VUFIND_HOME/install.php) provides the option of initializing a custom module. This establishes a directory and namespace where you can store your local configurations and code. It also sets up the VUFIND_LOCAL_MODULES environment variable that your Apache configuration uses to tell VuFind to load the custom code. Even if you already have VuFind set up, you can run the install script a second time to make adjustments; just be aware that it will create a new Apache configuration in $VUFIND_LOCAL_DIR (while also making a backup of your existing configuration, in case you need to roll back).

Your configuration overrides belong in /module/[your module name]/config/module.config.php. Your custom code belongs in /module/[your module name]/src/[your module name], and it should live in a PHP namespace that corresponds with the module's name.

For information on some of the types of custom code you might wish to include in your module, see the plugins page.

Starting with VuFind 2.4, some code generators are available to help save time when you build customizations in your local module.

Further Reading

See some useful applications of the VuFind customization on the installing multiple instances page.

See the Code Generators Part 1 video for a hands-on example of setting up a local code module.

development/architecture/customizing_vufind.txt · Last modified: 2021/08/03 14:03 by demiankatz