Skip to main content

Questions tagged [matrix]

Matrix fields allow you to create multiple blocks of content within a single field.

54 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5 votes
0 answers
217 views

Eagerloading Matrix fields resulting in empty array

I'm trying to eager-load a Matrix field with it's blocktype and related field types. For some reason the _eagerLoadedBlockTypeElements are empty arrays. If I get rid of the with clause on ...
Chris's user avatar
  • 51
3 votes
0 answers
220 views

Neo performance (large page)

I'm using Matrix and Neo to build out quite large, complex entries. On larger pages (70+ blocks each with one-multiple sub-blocks) the performance is taking a bit of a hit taking upwards of 40 seconds ...
Cole Henley's user avatar
  • 1,741
2 votes
0 answers
80 views

How do you access the Label of a Table field column with a Type of Dropdown?

How do you access the Label of a Table field column with a Type of Dropdown? I have a Table field in a Matrix block and one of the column types is a Dropdown. When I use the {{ row.handle }} syntax ...
doctorgloom's user avatar
2 votes
0 answers
132 views

Can't seem to get reverse relational field working from within a Neo field

Has anyone managed to get reverse relations from a Neo field working? I have a Neo field containing an Entries field which works fine on the page/section entry where I have the Neo field, but I’m ...
richardpixel's user avatar
2 votes
0 answers
123 views

How can I validate/make a matrix field required on the front-end?

I am displaying inputs on the front-end of my form that are populating a matrix within the CP. Overall everything is working fine. The problem I am having is validation. I've got the field marked as ...
Damon's user avatar
  • 4,706
1 vote
0 answers
16 views

Multilingual setup with different content structure per language

We'd like to setup a multilingual site with a parallel structure but different content per language. The content will differ specifically in the matrix fields that there will be. For example, German &...
Jane's user avatar
  • 11
1 vote
0 answers
49 views

cannot create matrix in craftcms 4.2.3

I just created a fresh project with craftcms 4, but am running into issues creating a matrix. Even with just one block field. It gives me the error Cannot assign string to property craft\models\...
jbrightdev's user avatar
1 vote
0 answers
28 views

Querying entries that have not been related to any other entry or contained matrix element

I have a large amount of content that we are attempting to collect before we migrate to our new site structures. Normally the staff are supposed to relate content back to main entries to make sure ...
Christopher Kennedy-Nuñez's user avatar
1 vote
0 answers
126 views

Migrating to Matrix using Feed Me and Element API

How can I use Element API to move my entry fields into a matrix-based content builder? I'm going off the docs found at https://docs.craftcms.com/feed-me/v4/guides/importing-into-matrix.html#setup-your-...
Christopher Kennedy-Nuñez's user avatar
1 vote
0 answers
91 views

Syntax for eager loading assets from multiple matrix block types

When eager loading assets from within a matrix block like so: {% set blocks = entry.relatedCategory .with([categoryBlocks.blockType.blockAssetField]) .all() %...
Nick's user avatar
  • 141
1 vote
0 answers
138 views

Importing set of flat fields into multi-row matrix using Feed Me

I'm using 'Feed Me' in Craft 3 to import data. The data has 9 fields (like full_name_child_1, and gender_child_1...) and has 10 sets of them (all the way to full_name_child_10, etc). I originally ...
Gary Reckard's user avatar
1 vote
0 answers
268 views

How to exclude a Matrix block from search?

I'm using a Matrix field as a content builder, allowing the editor to freely create content blocks, titles, images, etc, etc. All of which is content that is required to be searched. But also included ...
Peter Lewis's user avatar
1 vote
0 answers
87 views

Order entries by a matrix field category

I have a lot of trouble in understanding the database/model structure and how to work with the query builder. I tried playing a bit with leftJoins but i cannot seem to make complex queries in craft 3. ...
Dimitri van der Vliet's user avatar
1 vote
0 answers
146 views

Craft 3: Possible to merge checkbox and text values from a frontend form and put into a plaintext Craft field?

Is it possible to submit checkbox array and text values on a front end form into a plaintext Craft field in Craft 3? My solution worked in Craft 2 but it broke in Craft 3 due to some under the hood ...
Lori's user avatar
  • 866
1 vote
0 answers
41 views

Why does calling matrix block type before matrix block loop lead to no loop output

In the code below I am trying to check for the presence of a quote block to help define some layout columns. As soon as i count an individual block, the loop block below it outputs nothing. If remove ...
joomkit's user avatar
  • 2,034
1 vote
0 answers
84 views

Idea for matrix alternative for multisite setup. Feedback needed!

We have a site that has relied heavily on the use of matrix fields to act as a content builder for several pages on our site. We are now in the process of localizing the content, and have set up ...
jsun's user avatar
  • 113
1 vote
0 answers
61 views

SuperSort Matrix Block sort by Year / Month / Now Data

{% set allCVs = entry.profileCv.all() %} {% set cvEntries = [] %} {% for item in allCVs %} {% set fromMonth = item.fromMonth.value %} {% set fromYear = item.fromYear %} ...
Mvrcel Boer's user avatar
1 vote
0 answers
371 views

Join Matrix Fields To Query Using andWhere

My question is this, I want to join a matrix table to a query and look for certain values in it. I am using this example below. I have 2 matrix fields partsModels.model and partsModels.parts. I need ...
Vin's user avatar
  • 383
1 vote
0 answers
198 views

Front end entry dropdown with null option

I have successfully implemented a front-end form that allows the user to add new "blocks" to a certain matrix field. This matrix field has one text field, two date fields, and one entry field that ...
Steven Thate's user avatar
1 vote
0 answers
95 views

Import CSV to matrix field

How should I structure a .csv and process the data to import matrix fields? Whith table I used a json_encode but of course this doesn't work with matrixes.
Alessio Breviglieri's user avatar
1 vote
0 answers
413 views

Using element API to query a matrix field

I'm using the Element API to grab entries and their data (via this answer). What I want to do is accept a URL parameter (eg. ?location=foo) and filter the returned entries by a Matrix field called ...
Matt Andrews's user avatar
1 vote
0 answers
46 views

Attaching a file to a Matrix field and then saving the entry takes up to 2 minutes

I have an issue with attaching a file to a Matrix field and then saving the entry takes up to 2 minutes. If I open up another tab with the Craft CMS admin interface I can see that Craft is performing ...
Pim Verbij's user avatar
1 vote
0 answers
229 views

Frontend upload asset to Matrix

I created a matrix with 1 type, 3 fields for user profile. I use front-end to upload file to documentUpload field. But I got PHP warning: array_merge(): Argument #1 is not an array message. I Google ...
Angela Chan's user avatar
1 vote
0 answers
75 views

Display entries linked from Matrix field according to the entries' structure and a light switch in the Matrix

In a channel (market), I have a Matrix field (market_products) with a Stucture-based Entries field (products) and a Lightswitch field (active/inactive). For each market, I need to create an ordered ...
Shanan Galligan's user avatar
1 vote
0 answers
164 views

Combined searches and filters with a Matrix

I am fairly new to Craft but have managed to build a combined search feature that users can filter from dropdowns. I used this as a guide and it works great: https://webstoemp.com/blog/combined-...
GrettyGoose's user avatar
1 vote
0 answers
304 views

Getting type of element inside of a matrix field using plugin hook

I've been trying to deal with saving matrix fields to an external API by hooking onto the craft()->on('entries.saveEntry) function in a custom plugin I made. Matrices are nice for content authoring,...
medee88's user avatar
  • 23
1 vote
0 answers
86 views

Search syntax for searching matrix fields (in the CP)

Looking for a way to search (in the CP), for elements where a matrixField is empty or not. This seems to work: - with matrix rows: myMatrixField::* - without matrix rows: -myMatrixField::* However, ...
Tim Kelty's user avatar
  • 3,081
1 vote
0 answers
55 views

Return Category from Inside Matrix

I'm having difficulty returning a category from inside a matrix block. So I'm returning a student based on a studentNumber variable {% set studentParams = { section : 'students', '...
andrew-caulfield's user avatar
1 vote
0 answers
296 views

Saving some entries and a matrix field settings takes a very long time

I have some issues with saving fields and entries in Craft. For some reason, some entries, and a Matrix field I have, take approx. 1 to 2 minutes to save. There are then errors in my server log. ...
Laurence Cope's user avatar
1 vote
0 answers
460 views

Advanced filtered search: Matrix fields and arrays

Having scoured the forums for similar questions of which there are a few, I'm still struggling to figure out my specific usecase. I have 4 filters and a search box (which searches a custom tag field) ...
Rob's user avatar
  • 865
1 vote
0 answers
102 views

Grouping entries by days in matrix field

So this is proving a lot harder than I thought. I have a 'tours' section containing tours, which all have several departure dates. Those dates are in a matrix field, entry.data. So there's only one ...
Niels's user avatar
  • 75
1 vote
0 answers
49 views

Possible to repopulate locale defaults?

When a locale is first created, it seems it receives all of the default locales content. Is it possible to have this happen for a specific field after the fact? I have a large matrix (with subtle ...
Matt Fordham's user avatar
1 vote
0 answers
240 views

Delete matrix blocks based on their content

Is it possible to pragmatically delete a matrix block based on its content? I have a channel called "Artist", which has a matrix field with concerts. It'll be about 5-600 concerts in total every year, ...
peirix's user avatar
  • 431
1 vote
0 answers
337 views

Best way to save user data?

I have a user model that contains several Matrix fields, but for the sake of this question I'll just discuss one of those fields. The field we'll discuss is a phoneMatrix. The phoneMatrix data can ...
Matt V's user avatar
  • 491
0 votes
0 answers
16 views

5.x - Matrix Frontend Form Submissions

Has anyone found a way to create matrix field submissions with a frontend form? The docs for 5.x mention this section hasn't been updated and that the functionality has changed drastically. Craft 5.x -...
Jared Budlong's user avatar
0 votes
0 answers
18 views

Filter GraphQL Response Based on Matrix Entry Type

In Craft 5, we now have a few Entry types with Matrix fields that can nest several other Entry types, or none. I'm struggling to work out a way to limit the returned results based on the content of ...
theAdhocracy's user avatar
0 votes
0 answers
8 views

How can I list all entries that have a populated Freeform Form field?

The Freeform Form field can either be a direct custom field of the entry, or it may be inside a Matrix field's blocks or be a Super Table field. Ideally, I'd like to do this performantly, and either ...
Sandwich's user avatar
  • 636
0 votes
0 answers
14 views

Order Matrix Block in Control Panel by Date Field

Is it possible for the individual entries within a matrix field in the Control Panel to appear in the order of a date field? I have found here information on how the entries are sorted after saving ...
buckdanny's user avatar
  • 207
0 votes
0 answers
49 views

Changing Matrix Field Propagation Settings

I built a Craft multisite a few years ago. Most of the site pages feature a content builder matrix field with multiple blocks. Many sections are shared across sites. When I built the site, it seemed ...
JDub25718's user avatar
0 votes
0 answers
41 views

Why aren't my images displayed on the homepage

Our homepage.twig is a section Our Matrix is called "angebote" (it's german don't ask :D) We created two entries for our matrix This is our Code inside the homepage.twig file for including ...
Lina's user avatar
  • 1
0 votes
0 answers
34 views

Hiding enclosing div if all matrix block fields are empty (although they do exist because of another language)

I have an entry with matrix fields. If I add blocks in the main language, but its fields only contain data in one language, the block query (the for loop) still finds these empty fields since they do ...
Matthias's user avatar
  • 110
0 votes
0 answers
24 views

Store Hours field in Matrix

I'm using the Store Hours plugin inside of a Matrix field along with a text input field. The global is called specialHours and the matrix has the same name. I access the text input like this which ...
fodney's user avatar
  • 193
0 votes
0 answers
28 views

Missing Matrix content after upgrading from Craft2 to Craft3

I’m upgrading my Craft2 blog to Craft3 at https://brill.blog. I’ve got a loop to display text, images, and block quotes from a Matrix field, that follows this pattern: {% for block in entry....
Brian Liddell's user avatar
0 votes
0 answers
374 views

Feed me - Trouble importing table and matrix with translation

I'm trying to import entries to a chanell using Feed me but having some issues with table and with some multilingual texte in a matrix field. Craft edition & version Craft Pro 3.3.2 Feed Me 4....
Thibault Jadoul's user avatar
0 votes
0 answers
77 views

Add Matrix Blocks to existing Entry with Form without discarding existing Matrix Blocks

When I want to save an new Matrix block with an form to an existing Entry: <form method="post" accept-charset="UTF-8"> {{ csrfInput() }} <input type="hidden" name="action" value="entries/...
Rainer's user avatar
  • 11
0 votes
0 answers
164 views

Matrix Block query next prev

Good afternoon, Is it possible to have a next prev button to cycle through a number of matrix blocks within a single entry and show the blocks content individually on screen? The block contains an ...
user9822's user avatar
0 votes
0 answers
56 views

Setting a variable to a Matrix field with additional parameters

I'm trying to set a variable to a Matrix field and apply additional query parameters like so: {% set monthDates = entry.scanDates.type('dates').date('and', '>= ' ~ currMonthFirst|date('Y-m-d'), '&...
SoHo's user avatar
  • 403
0 votes
0 answers
91 views

Indirect Relationship defined in Matrix Block

I have 3 channels: Reviews, Products and UseCases. In the section "Reviews" an entry has a list of "Products", based on a matrix field. Every block in this matrix field represents one listed "Product"...
MISC's user avatar
  • 1,019
0 votes
0 answers
1k views

Craft 3 This field’s Volume configuration is invalid

I just upgraded a Craft 2 site to 3, and am getting this error from one of my matrix blocks. This field’s Volume configuration is invalid This what it looks like in backend: Oddly enough, I went ...
Dan Zuzevich's user avatar
0 votes
0 answers
68 views

Parsing a Dropdown Option Label in Matrix

How do I access the Dropdown Option Label in this matrix? <div class="post-weather"> {% for block in entry.weather %} {% if block.type == "condition" %} <span data-...
Nutmeg's user avatar
  • 598