https://github.com/getgrav/grav-plugin-filter-strings
Grav Filter Strings Plugin
https://github.com/getgrav/grav-plugin-filter-strings
grav grav-plugin string-manipulation stringy twig twig-extension
Last synced: 7 months ago
JSON representation
Grav Filter Strings Plugin
- Host: GitHub
- URL: https://github.com/getgrav/grav-plugin-filter-strings
- Owner: getgrav
- License: mit
- Created: 2015-10-16T01:31:05.000Z (over 10 years ago)
- Default Branch: develop
- Last Pushed: 2016-09-19T20:12:29.000Z (over 9 years ago)
- Last Synced: 2025-07-07T11:25:52.506Z (7 months ago)
- Topics: grav, grav-plugin, string-manipulation, stringy, twig, twig-extension
- Language: PHP
- Homepage: https://getgrav.org
- Size: 75.2 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Grav Filter Strings Plugin
**Filter Strings** is a [Grav](http://github.com/getgrav/grav) plugin that utilizes [Stringy](https://github.com/danielstjules/Stringy) to manipulate strings in twig templates.
# Installation
**Filter Strings** can be installed in two different ways; Our Grav Package Manager (GPM) install method is the easiest and most reliable method. However, the plugin can also be installed via a zip file.
## GPM Installation (Preferred)
Utilizing the system terminal the plugin can be installed from root.
In the system terminal navigate (change directories) to the root of the Grav project. Type in the following command:
bin/gpm install filter-strings
The command will install the plugin under the `/user/plugins` directory in Grav.
## Manual Installation
To install this plugin, just download the zip version of this repository and unzip it under `/your/site/grav/user/plugins`. Then, rename the folder to `filter-strings`. You can find these files either on [GitHub](https://github.com/getgrav/grav-plugin-filter-strings) or via [GetGrav.org](http://getgrav.org/downloads/plugins#extras).
You should now have all the plugin files under
/your/site/grav/user/plugins/filter-strings
# Usage
In order to use the **Filter Strings** plugin it needs to be enabled in the configuration files. By default **Filter Strings** is enabled. To call the plugin from twig use a pipe `|` and a function name (List of functions can be found in [Stringy](https://github.com/danielstjules/Stringy)) followed by an underscore and string (eg: `SomeStringVariable|titleize_string`)
> Note: Currently only Stringy functions that modify a string without arguments work. Other modifiers have not been tested.