Questions tagged [matrix]
Matrix fields allow you to create multiple blocks of content within a single field.
648
questions
1
vote
1
answer
37
views
Create section 'landing page' with 'two column block'
I'm very new to Craft 4.
I have a matrix 'Landing Page Blocks'
I've created 2 Block Types: Hero Block and Two Column Block
Within the 2 column Block I need a left and right content block
Within the ...
0
votes
0
answers
27
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 ...
1
vote
1
answer
23
views
I want to pull content from a field on an entry into a matrix block that is displayed on that entry, is this possible?
I want to pull content from a field on an entry into a matrix block that is displayed on that entry.
I have entries that are shared between multiple sites. I'd like to be able to add a field on these ...
1
vote
1
answer
44
views
Output matrix field content into a RSS feed
I'm trying to create RSS feed for a site news section, most of it is straight forward to do but I run into an issue with the description section. That content is a sub field in a matrix field along ...
1
vote
1
answer
27
views
Entry form replacing rather than appending data to a matrix field
I have this in my entry form:
{{ csrfInput() }}
{{ actionInput('entries/save-entry') }}
{{ hiddenInput('entryId', entry.id) }}
{{ hiddenInput('fields[questions][...
1
vote
1
answer
42
views
craft.matrixBlocks - related to entry
I've got classes by entry and each week is a matrix block inside that week. I'm then outputting all weeks together using this query
{% set startDate = date(now)|atom %}
{% set classes = craft....
1
vote
1
answer
36
views
Can not-related block types share a matrix field
I am aware that block types that are related should have a matrix shared. For example, to implement a slider, there should be image and caption block types inside a slider matrix.
But what about ...
1
vote
1
answer
34
views
Events with sub-events in a matrix field - display as a calendar (combined with other events)
I'm building a site where the client has courses that run once a week. We'll have several courses and each course will have a matrix with multiple blocks detailing that weeks class.
What I want to do ...
1
vote
1
answer
20
views
Matrix Field - Call block that matches block field value
I've got an event entry with each day of the event in a matrix field block. The block has a date field eventDate and I've got it set up so each block has a unique page that display with the date in ...
0
votes
0
answers
37
views
Import Image on Matrixblock via GraphQL Mutation
I'm trying to create an Entry via a GraphQL mutation. The whole Entry consists of one Matrix(handle: siteimportmatrix ) with one Block(handle: importblock ) which has 4 fields one of the fields is an ...
1
vote
1
answer
43
views
Deleting matrix block on front end form
The below code doesn't appear to be working for me, it will delete all other blocks apart from itself. I just need it to delete itself.
trophyOrders is the Matrix field in the user account.
{% set ...
1
vote
1
answer
65
views
Update user matrix field dropdown through module
Appreciate I may be asking for a lot here - I have an existing module that I use to fire events when a stripe order is completed.
I would like to iterate through some User matrix blocks and update a ...
2
votes
1
answer
169
views
Generate a unique ID for each instance of a block from matrix field
I have a question regarding Matrix fields.
I have a matrix field where one block will be used multiple times (around 4 or so) on each page. When that block scrolls into view I am firing a javascript ...
1
vote
1
answer
35
views
Retrieve tags used in matrix field
I have a matrix field that includes a tags field. The matrix includes a list of events, with each event using the tag field to determine topics. I'd like to output a list of each tag used, so I can ...
0
votes
0
answers
17
views
Import Into Matrix via FeedMe is Empty
Looking for an advice on proper syntax to have the address data imported into the matrix field. Currently is remains empty. All other data/values work fine
{
"entry": [
{
"...
2
votes
1
answer
75
views
Resaving Matrix Blocks skips because of "not loading its content"
We recently updated one of our biggest projects to Craft 4. And today I tried to resave all the matrix block with resave/matrix-blocks but was greeted with the following behaviour:
Does anybody have ...
1
vote
1
answer
27
views
Filtering entries via a table field inside a Matrix Block
James helped me with part one and it's working well: Filtering entries via a dropdown inside a Matrix Block
Now I would also like to filter by a table field as well. The table is extras and the ...
1
vote
1
answer
58
views
Filtering entries via a dropdown inside a Matrix Block
I have Entries with a Matrix field called events. I have an Entries field and a Dropdown field inside those Matrix blocks (block type event). I'm currently filtering by entry using andRelatedTo(['and',...
0
votes
0
answers
83
views
Programmatically change value of plaintextfield in matrixblock on Entry presave Event
I'm new to craft cms and try to write a module which should hook into the EVENT_BEFORE_SAVE and change the value of a plaintext field within a matrix block. Therefore I've set up the Module just like ...
0
votes
1
answer
210
views
Import CSV data using FeedMe plugin into entries with Matrix fields
I would like to import a CSV file into but the entries contain Matrix fields. When I set up the file, FeedMe provides a way to map columns in the CSV file to specific Matrix fields but I can't find a ...
1
vote
1
answer
114
views
FeedMe import to update specific Matrix blocks without affecting others
I'm familiar with using FeedMe to import into Matrix blocks, but I’m not sure how to do the following:
I have a series of existing entries, each with a series of existing Matrix blocks of several ...
1
vote
1
answer
38
views
Finding next and previous entry within multiple matrix fields
First of all I have looked through various similar questions/answers, but don't think any of them address my specific problem.
I am building a website for an artist, and I have a Category which I've ...
0
votes
1
answer
43
views
Deleting a matrix block type that was copied in code
I'm somewhat new to Craft, and struggling a bit with copying matrix block types. Any help would be greatly appreciated.
So, I have some code that copies a matrix block and its fields, but when I go to ...
2
votes
1
answer
87
views
Updating specific field in from block in matrix field via migration
I'm trying to update a specific field (a dropdown) in an existing block (of type 'subhoofding') in an existing matrix field 'contentBuilder'
The migration itself runs fine, show the new value as ...
1
vote
1
answer
108
views
Saving data in a table field in a matrix field via entry form
I have an entry form with both table fields and matrix fields containing table fields. I can save data into the table fields OK with fields[fieldHandle][X][colX] but with the below, I get a matrix ...
0
votes
1
answer
37
views
PDO Exception when accessing a matrix field
This is a really strange issue - everything had been working fine for many months then all of a sudden three specific entries in the same section started throwing PDO Exception (see screenshot below). ...
1
vote
0
answers
12
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 &...
2
votes
1
answer
167
views
Adding New Matrix Block via Frontend in Craft 3
Referencing https://craftcms.com/docs/3.x/matrix-fields.html#saving-matrix-fields I believe I did this correctly according to the docs and other posts here. My Matrix field is able to save edits, but ...
1
vote
0
answers
42
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\...
1
vote
1
answer
122
views
Eager loading results in more queries
From what I understand it is wise to always eager load assets, I used it successfully in other cases, but here it results in a more queries, not fewer.
I am trying to eager load an asset in a matrix ...
1
vote
1
answer
31
views
Reordering Matrix blocks by date in the control panel when saving an entry
I'm trying to reorder Matrix Blocks in date order when saving an entry in the control panel. I kind of have it working using the following code.
My Matrix field is 'events'. Each block contains a date ...
0
votes
1
answer
64
views
Adding multiple blocks for matrix in form
I am using a matrix field for registered users on my site.
I want to be able to add a certain amount of matrix blocks to each users on registration (with hidden input), so I can re-use them later on.
...
0
votes
1
answer
117
views
Debugging slow loading entries with matrix field in Control Panel
From a recently migrated Craft CMS 2 site, there are various entries in the Control Panel which take a very long time to load (sometimes over 30 seconds). This is the same in our production ...
1
vote
1
answer
552
views
NEO plugin - How to access child elements
I'm a newbie at using Neo and am finding it hard to get the concept correct for nesting and retrieving child elements.
I have been trying to retrieve them by creating element queries, but I am unable ...
1
vote
1
answer
37
views
Sorting all matrix fields from multiple entries as one list
I have a section with a matrix field that collects multiple notes for each entry, each marked by the date the note is entered. Conceptually, the data is organized within the entries as:
Entry A
...
1
vote
2
answers
75
views
How to get the image from the last matrix block using twig's last filter
I am on Craft CMS version 4.0.4. I used the last filter to get the last matrix, but when I tried to get the image, I kept getting an error:
Impossible to access an attribute ("image") on a ...
1
vote
1
answer
78
views
Matrix field entry link corrupted
Some of my links coming from a matrix field with entry became corrupted. Anyone had this before and knows how to fix it?
0
votes
1
answer
219
views
trying to insert super table field values using graphql in craft cms
cant able to store values from super table field,need a correct format to do
Graphql
mutation saveEntry($superTable: [demoSuperTable_SuperTableBlockContainerInput] = {demoSuperTable_0: {id: "&...
1
vote
0
answers
67
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 ...
1
vote
1
answer
61
views
Matrix content disappears in Live Preview when updated
I'm having an issue where, if I edit any matrix content in Live Preview, all matrix content disappears.
When I first open preview, any existing matrix content will display properly, but as soon as I ...
1
vote
1
answer
582
views
Creating an entry with a matrix field using GraphQL
I am trying to create a new entry in Craft CMS using GraphQL. The entry has a matrix field called "vehicles" that has a single block called "vehicle". This block has a single field ...
1
vote
1
answer
179
views
Asset Custom Field Returning Null in Array
I am relatively new to Craft CMS and I have encountered an issue that I have attempted to debug for quite some time.
When using the {% dd %} function to dump my array, a load of my custom fields ...
2
votes
2
answers
315
views
Matrix vs Neo, what should you use for 60+ multi site
Simple question: Which field type is more performant, Matrix or Neo?
I have to build a 60+ multi-site with different languages and I need to think about this architecture before building the pageParts....
3
votes
1
answer
105
views
How can I query entries related to another section’s entries having specific Matrix checkbox field values?
Let’s say I have a site with two sections: Things and Colors.
Things has a Matrix field (thingsBlocks) with a Sizes block type. That Sizes block type has a checkboxes field (sizes) with values that ...
1
vote
1
answer
36
views
Access Asset Type for subfolder
I want to create asset subfolders by page & by asset type.
I use an asset field in an matrix field for multiple asset types like video, images etc.
In an asset field I can access the slug of an entry ...
2
votes
2
answers
160
views
Cumulative Addition of Matrix field elements with Feed Me
Is it possible to add blocks to a Matrix field in an Entry using Feed Me without overwriting existing blocks? I know how to add multiple blocks at once with a single JSON file, but I won't have things ...
1
vote
1
answer
83
views
Matrix query fails when using multiple fields
I am on Craft3.5 and trying to build a matrix block query where I would like to return results from two different matrix blocks. The docs seem to suggest that this is possible.
This is the code I ...
1
vote
1
answer
62
views
craft.matrixBlocks() by section
Trying to grab the total count of matrix blocks that belong to a section. Looks like there is no section parameter for craft.matrixBlocks(). Not sure as to why that is.
Anyone know of another way that ...
1
vote
1
answer
158
views
Can't get a simple Reverse Relations for Entries field to work
I'm trying to get a simple Reverse Entries working, nothing fancy, but I'm stumped.
I created a little personal project just to help me stretch and learn Craft better. I picked the NFL Draft just ...
1
vote
1
answer
329
views
How do you delete a matrix block in module/plugin assuming you have the matrix block id and entry
I have the channel entry to which the matrix block belongs and I have the ID of the block itself. Does anybody know the correct approach for deleting the matrix block on the entry?
Context: module (...