toastnz/svg

A skeleton for Silverstripe CMS modules.

Maintainers

Details

github.com/toastnz/svg

Source

Issues

Installs: 2 373

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 3

Forks: 0

Open Issues: 0

Type:silverstripe-vendormodule

dev-main 2024-06-13 23:51 UTC

This package is auto-updated.

Last update: 2024-12-14 01:02:48 UTC


README

This module enables the usage of the $SVG('SVG_FILE_NAME') variable in SilverStripe templates and block templates. It allows you to easily include SVG files within your templates by referencing their file names.

Installation

To install this module, you can use Composer:

composer require toastnz/svg

Configuration

To set up the module, you need to specify the svg_base_path under the Page class in your YAML configuration file (app/_config/config.yml).

Page:
  svg_base_path: '/path/to/svg-folder/'

Make sure to replace '/path/to/svg-folder/' with the actual path to your SVG files.

Usage

Once the module is installed and configured, you can use the $SVG('SVG_FILE_NAME') variable in your SilverStripe templates. Here's an example of how to include an SVG file:

$SVG('logo')