Community Digest

Top new questions this week:

How to implement Laravel's collection `filter` method inside twig?

How to implement Laravel's collection filter method inside twig? Laravel: $collection = collect([1, 2, 3, 4]); $filtered = $collection->filter(function ($value, $key) { return $value > 2; }...

templating collections  
asked by user Score of 1
answered by James Smith Score of 2

Greatest hits from previous weeks:

Incorrect content/mime-type on S3 SVG upload

I've setup an S3 asset source for images and it's working well for everything but SVGs. SVGs are uploaded with the default content-type of binary/octet-stream where the correct content-type would be ...

assets s3  
asked by mrtobo Score of 2
answered by Brad Bell Score of 5

Failed to load resource: net::ERR_CACHE_MISS

I've run into this error from time to time: Failed to load resource: net::ERR_CACHE_MISS I've seen it being thrown by several different files. I don't know how to trigger it to better explain how ...

asked by Ben Parizek Score of 2
answered by Brad Bell Score of 3

Whitespace created when using if statements

I am using the following block of code in a template: <hr class="rule"> {% if entry.features | length %} <div class="feature-block"> <h4 class="is-uppercase">Features&...

templating whitespace  
asked by Niall Thompson Score of 10
answered by André Elvan Score of 10

What's the best practice for handling data migration and organization across development environments?

This issue becomes especially difficult when there are multiple environments, with multiple developers working on different features that affect the data structure. The holy grail is a git-style ...

migration deployment environments database  
asked by Eric Ressler Score of 103
answered by Jeremy Gimbel Score of 49

Remove trailing comma from an output loop?

I want to create a comma separated list of categories to which an entry belongs, but without the trailing slash on the last element... can't work out how to remove it! {% for category in entry....

asked by Matt Wilcox Score of 7
answered by Seán O'Grady Score of 15

Is there a way to output only the first paragraph of a Rich Text field?

I have a rich text output section I want to limit to the first paragraph so I can link to a full version on another page. What's the best way to do this?

asked by Allen Pieper Score of 19
answered by Brandon Kelly Score of 28

striptags not removing <p> tag?

I've seen how you can remove html tags with twig in other posts here so I am using: <p class="slider--text">{{ product.intro|striptags('<p>')|raw }}</p> To remove the <p> tag ...

asked by Lettie Score of 4
answered by Mats Mikkel Rummelhoff Score of 11
You're receiving this message because you subscribed to the Craft CMS community digest.
Unsubscribe from this community digest       Edit email settings       Leave feedback       Privacy
Stack Overflow

Stack Overflow, 110 William Street, 28th floor, New York, NY 10038