You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 9, 2023. It is now read-only.
To apply a modifier to an array (tag pair), you should use the parameter syntax. eg. {{ gallery trim="true" }} {{ /gallery }}
...or use the pipe syntax on the closing tag, eg. {{ gallery | trim }} {{ /gallery | trim }} (but that's lame, so don't do that).
The trim modifier in your snippet is applying to the value of gallery, not the contents of the tag pair.
What you're probably looking for is another tag that wraps the whole thing, which strips out line breaks.
Thanks for getting back to me (and sorry for slow reply)... Cool the spaceless addon does the job perfect. I'd +1 the idea of having this built in as an antlers modifier in future though :)
Hey, not sure if this is a bug, feature request or I've just misunderstood the docs but here goes....
Expected behaviour
Using
trim
on a replicator or asset field would generate HTML with no whitespace.Actual behaviour
HTML has whitespace.
Steps to reproduce
The intention is that the above will yield the same output as the below, but this is not the case.
Server Details
Operating System: MacOS 10.12.5
Web Server: MAMP Pro
PHP Version: 7.0.15
Statamic Version: 2.5.11
Updated from an older Statamic or fresh install: Updated
List of installed addons: CookieConsent, Spock
Use Case
This is particularly useful when relying on
display:inline-block;
for layout as white space is taken into account. Example styling:Being able to
trim
blocks of code like this would allow you to author code in a more readable format.The text was updated successfully, but these errors were encountered: