Community Digest

Top new questions this week:

Showing and playing video's in Twig templates

I want to be able to upload and play videos on my Craft CMS website. I created a volume and field to hold these videos. So far so good, but whenever I want to output the video in a video tag I'm not ...

templating assets  
asked by J1989 2 votes
answered by dmatthams 1 vote

sort by checkbox field with multiple options and by postDate desc

Section handle: players field handle: teamName The checkbox field has two options: Cubs Tigers Not all players will have the teamName field checked. I want to order players who are Cubs or Tigers ...

entries order sort  
asked by Brad 2 votes
answered by Andy 2 votes

Order entries by related "Year" category and paginate?

I have a section called Library, and a category group called libraryYears. The categories in that group are just years (2021, 2020, 2019...) Each entry in the Library is related to a year in the ...

categories pagination group  
asked by Mike Mella 2 votes
answered by James Smith 0 votes

Title Format - Object Label instead of Value

I am trying to get the label from an object instead of its value to use as the automatic title for my entries. For example: I have an entry that contains a dropdown with the handle exampleOne with ...

asked by Matt 2 votes
answered by Joorren 1 vote

Class '...SiteModuleService' not found when used inside scout.php

I have a custom SiteModule that is used inside scout.php to deliver indexing data to Algolia. I have followed CraftQuest's tutorial on creating a custom SiteModule for handling the indicies. The setup ...

modules composer  
asked by nitech 1 vote
answered by nitech 2 votes

Rendering form from Entry Field

I'm trying to pass an entry field type "Formfield" into a template. I have it working without passing any custom values through but when I do it outside of the render tag, No matter what I ...

craft3 form plugin-freeform  
asked by Ben 1 vote
answered by darylknight 1 vote

Setting numerical key values in a hash

I now know the answer to this but I’m posting it here as a note to myself and in case it helps people. Let's say you are looping through some entries and storing values in a hash… {% set myHash = {} %}...

asked by Jonathan Schofield 1 vote
answered by Jonathan Schofield 2 votes

Greatest hits from previous weeks:

How safe is auto-updating?

I have auto-updating currently disabled using the "allowAutoUpdates" config setting, due to concerns about plugin compatibility and unforeseen breakages, mainly due to experiences with other CMS's. ...

asked by Alex H 28 votes
answered by Brad Bell 66 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

HTTP 503 – Service Unavailable – craft\web\ServiceUnavailableHttpException [installation]

I tried installing Craft 3.0 using composer (php composer.phar create-project craftcms/craft PATH) And when I try to access the /web folder it's giving me the following error. I have tried removing ...

asked by kaydee 7 votes
answered by andrew.welch 7 votes

Using Twig to merge an array and remove duplicates

Problem I'm building a .json file for a search component of a used cars website. The file needs to be built from the output of two sections within CraftCMS, Used Cars and Vans & Trucks. It ...

templating array merge  
asked by R0wan 5 votes
answered by Jeremy Allen 8 votes

Empty date field becomes today's date

I have a date field, and I want it to be possible for this to be empty. How it works now is that if you don't enter a value, it takes today's date. Any suggestions?

asked by Wobee 2 votes
answered by carlcs 8 votes

composer update missing zip extension (ext-zip) on MacOS

When doing a composer update in a Craft project on MacOS Catalina, I suddenly get the following error: ***** requires ext-zip * -> the requested PHP extension zip is missing from your system. Any ...

craft3 composer zip  
asked by Matthias Redl-Mann 2 votes
answered by Matthias Redl-Mann 4 votes

Use a Twig macro to set a variable

Is there any way to use a macro in twig to define a variable outside that macro? For example, say you want to use a macro to set a variable that stores an entry's parent (I know you can do this much ...

templating variable macro  
asked by bravokiloecho 8 votes
answered by Alec Ritson 12 votes

Can you answer these questions?

Removing or hiding certain fields from the CP new entry for a specific user group

I'm trying to make some fields unavailable for a certain user group when they create or edit a new entry. These fields should only be available to admin users. I had implemented this by extending the ...

plugin-development craft3 field user-groups  
asked by valley 1 vote

Craft Commerce - Stock And Cart

What if two people have the same item in the cart and it is the last in the stock one of those people finishes the purchase, then technically that product is no longer in the inventory that happens ...

plugin-craftcommerce ecommerce plugin-craftcommerce3  
asked by Johanna Maldonado 1 vote

Missing New Entry button/dropdown when overriding the Entries Control Panel page

I have developed a module which overrides the entries page in the admin control panel as we need some custom fuctionality on that page. It's mostly working, however when I set the element type in the ...

asked by user15409152 1 vote
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