Community Digest

Top new questions this week:

Pass aspect ratio as variable into imager

I use imager to transform images and I want to pass the image ratio as a variable: {% set customRatio = 1/1 %} {% set image = craft.assets().one() %} {% set transformedImage = ...

templating variable plugin-imager  
asked by KSPR 2 votes
answered by André Elvan 2 votes

How to wire html template to twig extension? (Mainly `Twig\Error\SyntaxError: Unknown filter Error`)

I am going to use a Twig filter function by using Twig extension in my HTML file. I followed this guide. But when I run <p>{{ 123 | ...

craft3 php yii  
asked by apollo 2 votes

Link to a nested category

I'm using a matrix field to allow the author to add products they can link to category pages, but my code: {% for block in entry.transformerProductNavigation %} <a href="{{ ...

matrix categories nested  
asked by user2569 1 vote
answered by user2569 1 vote

Craft CMS/Feed Me slow performance

I am wondering if I have structured my data badly and was hoping someone could advise on an alternative. Essentially I have a structure with two types, a catalogue and the catalogues children. Some ...

craft3 plugin-feedme  
asked by Moucky 1 vote
answered by user3788089 0 votes

Greatest hits from previous weeks:

How can I retrieve channel data in json format?

I've played around with a few implementations but I still don't feel like either is right. I first came across building the JSON itself. This would be in a file at "craft/templates/entries.json". [ ...

entries json  
asked by Bill Criswell 35 votes
answered by Brandon Kelly 23 votes

How to output a field as raw HTML?

I have a field in a matrix block that is used for video embed codes. I want to output the contents of that field directly as HTML. However, it always seems to get entity-encoded (ie. the < and > ...

templating filter escaping  
asked by Nick F 12 votes
answered by Nick F 7 votes

Best method of text truncating

I see that there are Trimmer and Truncate out there that have been created for truncating text but I don't believe either does what it is I'm looking for. I'd like to truncate text similar to how ...

templating richtext  
asked by Christopher Healey 16 votes
answered by Ryan Shrum 18 votes

Twig combined conditionals to set variable

I am trying to check for the existence of a text field and an asset field and set an icon variable depending on the result. I don't seem to be having much luck with defined, length and empty ...

asked by joomkit 3 votes
answered by Xpertbot 3 votes

Craft 3 language switcher

Does anybody successfully implemented a language switch run Craft 3? Trying the Craft 2 variant slightly adjusted but still running into issues: Invalid site handle: nl <ul> {% set otherLocales ...

localization craft3 multi-site  
asked by Robbie Post 4 votes
answered by Robin Schambach 12 votes

How can I check on the value of a template variable?

If I'm used to PHP's var_dump() and print_r() to check the value of a variable, how can I evolve to inspect things in Craft where Twig's dump isn't available?

templating debugging  
asked by Matt Stein 19 votes
answered by Iain Urquhart 13 votes

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 2 votes
answered by Brad Bell 3 votes
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