Questions tagged [matrix]

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

Filter by
Sorted by
Tagged with
1 vote
0 answers
4 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 &...
  • 11
1 vote
1 answer
34 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
23 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\...
0 votes
1 answer
25 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 ...
0 votes
0 answers
20 views

Custom plugin: Retrieve fields (Matrix and MatrixBlock) from entry

I am currently trying to write a plugin that would process the entire content of an entry in such a way that I could send all the texts to a translation API, which I could then save back again. ...
0 votes
1 answer
16 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
26 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. ...
  • 19
0 votes
1 answer
34 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,041
1 vote
1 answer
45 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 ...
  • 299
1 vote
1 answer
28 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 ...
  • 135
0 votes
0 answers
14 views

FeedMe import matrix field with localized content overwrites other lang content

I have Craft setup with 2 sites in the same group and have assigned a language to each. I imported all content via FeedMe, configuring it to create new entries on the ITA site. Entries include a ...
  • 141
1 vote
2 answers
22 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 ...
  • 21
1 vote
1 answer
26 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?
  • 19
0 votes
1 answer
50 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
39 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
29 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 ...
  • 960
0 votes
0 answers
17 views

Fields are saved, but not loaded for some blocks

I'm experiencing an issue on my development-environment, and I cannot figure out what's going on. It seems that the fields of some of our blocks aren't being retrieved after saving. To reproduce I ...
1 vote
1 answer
197 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
54 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 ...
0 votes
0 answers
32 views

Sort Entry Array by date in Matrix Block

Goal I am listing theater plays. Each play has multiple show dates and corresponding places for each date. Each date & place combination is recorded in a matrix block (matrix field handle: shows), ...
  • 21
2 votes
2 answers
149 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
57 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 ...
  • 3,931
1 vote
1 answer
31 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 ...
  • 215
0 votes
0 answers
34 views

Eager load only ids() for related entries?

I'm hoping to slim down this query, as it doesn't scale how I need it to (having potentially hundreds of thousands of Matrix Blocks). {% set redeemedOffers = craft.matrixBlocks() .typeId([5]) ...
  • 367
1 vote
2 answers
75 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
49 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
50 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 ...
  • 117
1 vote
1 answer
90 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
167 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 (...
  • 75
1 vote
2 answers
92 views

New Matrix blocks aren't saving via front-end entry form

I have an entry type with simple Matrix field which has just one block type [activity] and several other non-matrix fields. My front-end entry form works perfectly on non-matrix fields, but for some ...
1 vote
1 answer
44 views

block.type.handle Content Builder Matrix loop

I am attempting to make use of the method listed here https://nystudio107.com/blog/creating-a-content-builder-in-craft-cms twig template: {% extends '_layouts/base.twig' %} {% block sectionHeader %} ...
3 votes
1 answer
107 views

Efficient way to get all related entries assigned to matrix fields across a set of entries

I have a scenario where level 1 structure entries each have several to tens of level 2 child entries, and several to tens of entries in a different channel which are also allowed to be related to the ...
1 vote
1 answer
31 views

Why does the matrix field produce such a massive amount of duplicate information?

The matrix field in Craft CMS is producing massive quantities of duplicate data. About 70 database rows per entry. Is there something I'm doing wrong? I don't think this will be sustainable for my ...
1 vote
1 answer
77 views

Populating Matrix Blocks with JavaScript

I need to populate a matrix block field with JavaScript in the control panel. I've got the data ready, but i can't figure out how to add it. I've located a function called addBlock() in MatrixInput.js ...
  • 155
1 vote
1 answer
68 views

Output Channel entries on another page with a matrix block

I know im doing something small wrong but I cant see what at this point. I have a channel called 'testimonialEntries' and I want to randomly output one of these entries on seperate pages. I cant ...
  • 132
1 vote
1 answer
75 views

Display something in the middle of post content

My entry content is displayed like this: {% for block in entry.postContent.all() %} <div class="my-4"> {% if block.type == 'text' %} {{ block.text }} {% elseif ...
1 vote
1 answer
83 views

Show matrix fields based on quantity [Sprig]

I'm using Commerce to sell tickets to an event and need to get the names of each person. I would like to do this via a Matrix field, showing fields based on the quantity selected. I followed along ...
  • 347
1 vote
1 answer
48 views

Autogenerated PDF Thumbnail using PDFThumb in a Matrix Field

I would like to autogenerate a thumbnail of PDF's, and from this question I found the plugin PDFThumb. The problem I'm running into is I'm relatively new to Craft, and I can't seem to figure out how ...
1 vote
1 answer
70 views

How to search for Entries that have a particular Category set within a Matrix field in the Control Panel?

I have an arrangement like this: Entry type 'people' └ Matrix field 'offices' └ Block type 'office' └ Category field 'building' On the Entries screen, how can I search for people that have a ...
0 votes
0 answers
37 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 ...
  • 1
1 vote
1 answer
27 views

Display field content inside a matrix from a different locale

I am building a site with 2 different languages - English and Chinese. Is it possible to retrieve only one field inside a matrix in English while I am in Chinese site? But the rest of the matrix ...
  • 11
0 votes
0 answers
32 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 ...
1 vote
1 answer
188 views

How to get values into twig template for fields of type Matrix in Craft CMS 2?

CMS: Craft CMS 2 In my admin panel I have globals set called X (under "Globals" from the sidebar and defined in craft_globalsets in the db from Global->Settings->New global set). A ...
  • 113
1 vote
2 answers
78 views

Getting blocks from matrix and injecting them throughout a page, NOT a single loop statement

I have a matrix field that allows the user to add little 'designed' features throughout the page. These are placed in certain positions on the page and so I want to loop through these but because they ...
  • 1,844
1 vote
1 answer
603 views

What's the difference between Neo and Matrix fields?

Im a bit new in Craft CMS But so far to me, seems like both allow the user to create multiple blocks of content
1 vote
1 answer
58 views

Pull Matrix Block from Multiple Entries without Showing Duplicates

I have a set of entries I am pulling ID. (group) Each of those entries has a Matrix Block. (people) That Matrix Block Type (person) has an entries field. In some cases the same entry (person) is ...
1 vote
1 answer
77 views

Set fields from two different Matrix blocks, merge them and then set the output in a pretty way

Newbie here, still grappling with basics, let alone elegance. My aim is to pull content from four different fields held in two different Matrix blocks and pass the output in a nice human readable ...
  • 113
0 votes
0 answers
22 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 ...
  • 183
1 vote
2 answers
42 views

Matrix fields don't load!

I have some matrix fields defined: But when I use the matrix blocks inside of an entry - I don't get all blocks - just the richText ones. I tested it out - just the richtText Matrix blocks will be ...
  • 235
1 vote
1 answer
427 views

Change matrixblock field value before save element

So i have a Matrix with one type of matrixblocks. These all have a field for a custom id which should be set by the system, if empty, before the entry is saved. I can access the individual ...
  • 369

1
2 3 4 5
13