Download the PHP package innoweb/silverstripe-remove-trailing-slash without Composer
On this page you can find all versions of the php package innoweb/silverstripe-remove-trailing-slash. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download innoweb/silverstripe-remove-trailing-slash
More information about innoweb/silverstripe-remove-trailing-slash
Files in innoweb/silverstripe-remove-trailing-slash
Package silverstripe-remove-trailing-slash
Short Description Removes the trailing slash from page links.
License BSD-3-Clause
Homepage https://github.com/innowebau/silverstripe-remove-trailing-slash
Informations about the package silverstripe-remove-trailing-slash
Silverstripe Remove Trailing Slash
Overview
Removes the trailing slash from page links.
SiteTree is the only class in Silverstripe that adds trailing slashes to links. This module cleans that up.
Requirements
- Silverstripe CMS 4.x
The changes from this module have been folded into core for Silverstripe 5, see 2780.
Installation
Install the module using composer:
Then run dev/build.
Configuration
Unfortunately, SiteTree::RelativeLink()
contains an issue, where the base link and action are joined with a forced /
. When no action is available, this leaves a trailing slash.
Because the extension point updateRelativeLink
is called before that join, you need to overwrite Page::RelativeLink()
with the following code:
See details to this issue in pull request 2677.
License
BSD 3-Clause License, see License