Questions tagged [matrix]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
14 views

Super Table fields in Matrix blocks not automatically propagating content across sites

Please bear with me as I try to explain what's going on. Feel free to ask for more details if needed. Simply put, Super Table fields in Matrix blocks are giving me trouble for multi-site. I am ...
2
votes
1answer
32 views

Filtering a Matrix block for future dates

I'm struggling with filtering future dates in a Matrix block that contains a date field. I would like to display 'Open' or 'Closed' as the result of a condition checking if the value of matrix rows ...
1
vote
1answer
19 views

Existing contents get deleted on Live Preview when adding new content on a matrix field

When I add a new content for a matrix block field on an existing entry, all its previous contents gets deleted from the Live Preview, except for the editor which still has the previous contents. And ...
1
vote
1answer
42 views

Order matrix blocks by date field

I'm using a matrix inside a Super Table to organize events, and I'd like to order the events using the date field for each event. I'm currently showing the first five events using limit then using ...
0
votes
0answers
15 views

How to add new Matrix block to entry field in php?

$draft = new Drafts(); var_dump($entry->slug); $draftEntry = Entry::find()->slug($entry->slug)->one(); $draftEntry->typeId = 32; ...
1
vote
1answer
17 views

“Field Limit is too big for your chosen Column Type” error on already existing fields when updating matrix

I'm getting the following error when I'm trying to update a matrix: "Field Limit is too big for your chosen Column Type."" I'm trying to add a new block type but this error keeps getting up on ...
1
vote
1answer
9 views

Matrix-field with a category-field to output category-title on single entry page

Me and categories, always giving trouble :) On blogs, we are using a matrix field and in one of the matrix-types, I have a category field. This is to output the title of the category. {% extends "...
1
vote
1answer
13 views

retrieve matrix data to twig file

I create a section clientSection which I linked an matrix field like in this image: The field has two block types : clientImage which has an field clientImage and clientDescription which has an field ...
1
vote
1answer
36 views

Pull info from a Related field within Matrix > within Super Table

Ok, my mind is about to implode with this… any help on template syntax very welcome! I have 2 Sections: ‘artists’ and ‘schedules’ In the ‘schedules’ section I have a Matrix field called ‘...
0
votes
0answers
29 views

Entries search parameter for date value in matrix field no longer working in Craft 3

We have a large festival events site where each performance is stored in a matrix field called dates which uses a single block which has a datetime field (date only). So if an event is on 3 different ...
0
votes
1answer
24 views

Performance basics? BlogPost+Comments vs. One ever-expanding Matrix Field?

New to Craft, and unsure how it works under the hood. In terms of overall performance, I'm curious to know which of the following scenarios is the most performant approach in terms of DB queries and ...
0
votes
0answers
13 views

How can you add a default set of fields to each matrix block?

We have a common set of default parameter fields I'd like on each matrix block on top of whichever other fields are configured. I'm trying to avoid managing them manually on each matrix block. What's ...
1
vote
1answer
31 views

Front end form with Matrix won't add more than one row

I have Notification entry with sendTo field and nViewed matrix: - viewedBy = Users field, limit of 1 - viewedDateTime = Plain Text User's don't see whole front end form, just a 'Mark as Read' link. ...
0
votes
0answers
22 views

Best way to display relevant matrixblock fields when doing a sitewide search?

I'm building a custom search results page which returns not only the entries that contain the search query (searchQuery), but also, the actual text/content in which the search query was found. That ...
1
vote
1answer
41 views

Additional criteria to filter status of field passed into RelatedTo

I'm trying to save all the images related to an entry in a variable. I need the images that are added through a matrix field in the entry. I'm using the following code, but am then also getting images ...
1
vote
1answer
26 views

Need help with filling matrix images into CSS grid

I want to fill in shuffled images into a CSS grid as a project overview. The images come from a matrix and have 4 different formats. So I want to fill in a format A image into the fitting grid cell (...
1
vote
1answer
45 views

Matrix Error - “Field Limit is too big for your chosen Column Type”

I have a matrix field which is used a my main Body content field. The site has just been updated to the latest version of Craft and I tried to add a block to the matrix field but when i try to save it ...
1
vote
1answer
24 views

Updating a matrix row in an existing entry using a frontend form

I am trying to update a specific row in a matrix field using a frontend form, I created them using another form with each row following the [new1], [new2] etc. naming format, but I can't seem to get ...
0
votes
0answers
26 views

Any second field in Matrix block coming out as NULL

For some reason, any time I add a Matrix block and add a second field it doesn't show - value is NULL. I upgraded from craft 3.2 to 3.4 recently.
1
vote
3answers
52 views

Images of Matrix not loading

First time working with matrix fields. In this case to load images. But somehow I can't manage to fetch the url of the Images. I can get the title and id but not the url. Can someone point me to the ...
0
votes
0answers
19 views

Query Events by Matrix Field using Where clause

I am new to Craft CMS. I am able to get a list off all upcoming events with: $events = Calendar::getInstance()->events ->getEventQuery( [ 'calendar' => 'sample_calendar', ...
0
votes
0answers
42 views

Entry matrix field returns empty array

I have updated Craft from 3.3.15 to 3.4.2 version, and encountered the following problem. I have a form that creates entry which has matrix fields in it, entry is successfully saved in the database ...
0
votes
0answers
23 views

Eager loading showing duplicated DB query

So I've had a read on Eager loading on CraftCMS from an article by nystudio107 and begun enhancing my website for a client but I'm currently running into an issue which I'm not sure could be fixed or ...
1
vote
1answer
40 views

How to process Matrix field in controller

I am trying to process a text field inside a Matrix field. In the controller I have this to get posted params: $element->setFieldValuesFromRequest($fieldsLocation); If I want to process a custom ...
1
vote
2answers
42 views

Proper way to implement array of objects as Craft field

I'm using Craft CMS for the first time and have a question about the proper/best practice to store what would equate to an array of objects (or just a plain array) in Javascript or JSON. Say I'd like ...
0
votes
0answers
22 views

Immutable alternative to Matrix block id?

We're currently using this code to generate a class name that can be used to style a matrix block on the fly (ad-hoc): {% for item in matrix.all() %} <div class="page-builder__item-{{entry.id ?? ''...
0
votes
0answers
23 views

Matrix field not displaying after updating to Craft 3

According to the documentation, this should loop through all Matrix fields. {% for block in entry.fieldname.all() %} But it's showing nothing. Everything is showing in the CMS itself, but not on the ...
1
vote
0answers
26 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-...
0
votes
0answers
22 views

Craft 3 Programatically Adding Block Types To Matrix

I have been attempting to programatically add blocks to a matrix field using the below code as part of a larger plugin learning project. use craft\fields\Matrix; use craft\fields\PlainText; //Create ...
1
vote
0answers
26 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() %...
1
vote
2answers
91 views

Matrix field within a matrix field

I am working on a product page where I want to give the option to the user to select between which sections they want to use eg banner section, description section, video section etc. Now since the ...
0
votes
0answers
20 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....
2
votes
1answer
38 views

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="{{ block.transformer.one....
1
vote
1answer
68 views

Supertable or Neo for nested Matrices and compatibility with Craft 4

I typically avoid using Supertable or Neo because I don't want the extra dependency going forward. However I'm in a project where I needed nested matrices. I know that in C4 nested matrices will be ...
1
vote
3answers
55 views

How can I restore Matrix content after accidentally changing its field type?

We accidentally deleted all our body text on all our pages, how do I redo my website to a older version. (24 hours ago) We changed matrix to assets and after that every body text disappeared.
1
vote
2answers
45 views

Matrix loop (nesting?) issue using switch

First let me say this: I'm new to Craft and Twig. So: my apologies for probably overlooking the obvious. I hope you can offer me some help... I've been trying for a couple of days to solve this puzzle....
0
votes
0answers
14 views

How to create other sites entries with same data, when “Save blocks to other sites in the same group” is used

We have fields, including a matrix field, that is set to "Save blocks to other sites in the same group". This means when we edit our English group, only sites in that group are edited, so they all ...
1
vote
1answer
51 views

Template output when grouping matrix blocks

I have a shared content builder matrix field that has the usual blocks: Redactor, Headings, Images, etc. A typical entry might look like this: - Heading - Redactor - Image - Redactor - Heading - ...
1
vote
1answer
24 views

Access Matrix field that is assigned to a user

Using Craft 3. I created the following field: myMatrix which has Field Type = matrix and is part of the group myGroup This is composed of one block: myMatrixBlock with 2 fields: myMatrixField1 ...
1
vote
1answer
101 views

In entries query, is there a way to check if matrix block is used?

I would like to get entries if a matrix field is used. Something like this: {% set query = craft.entries() .section('blog') .search('myMatrixField|length') .limit(10) %}
1
vote
1answer
32 views

Order grouped results by dropdown order

Following this topic, I have an additional question. The results are not ordered by the order of the Dropdown Options. How can I get this done? Code: {% set players = entry.myPlayersMatrix %} {% ...
0
votes
1answer
41 views

Removing a matrix row via front end entry form

Read some similar posts on here but they don't quite solve my problem. I've gt an entry form with a matrix field in it, and I’m trying to make it editable via front end entry form. Specifically I'd ...
0
votes
0answers
99 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....
0
votes
0answers
8 views

Craft 3 Matrix Field customFields property 'required' and 'sortOrder' fields null

I'm trying to dynamically build a frontend form based on a Matrix field. I'm iterating over the entry.aMatrixField.customFields array which returns me an array of field objects in Twig. The field ...
1
vote
1answer
22 views

relatedTo a category in a matrix field

All, I'm very close, but missing something and any help is appreciated. I have a teamMember matrix block allowing me to add employees with some basic info. One of the fields is a category field called ...
1
vote
1answer
94 views

How to search a matrix block with a specific handle?

I want to query a specific matrix block using text search which will search all the searchable fields in that particular block and give me output in the form of blocks that I can further process. I ...
0
votes
0answers
41 views

Set field value of table field within matrix in a module?

I have a matrix called 'Election' with the structure: Block: role - Text field: roleName - Table field: candidates -- Text field: fullName -- Number field: votes My module can edit the roleName ...
1
vote
1answer
24 views

Module Development - Get ID of a field within a Matrix field

I have a matrix field that has a Supertable matrix within it. I need to programatically get the ID of the field that is nested in the Matrix. I have the code below: $matrixField = Craft::$app->...
0
votes
0answers
19 views

SQL to delete all entries and a matrix field from the database direct due to Craft issues in the admin

What would be safe SQL commands to delete all entries from the database? And similarly to delete all content from a specific Matrix field? The reason is because Craft seems to have an issue with ...
0
votes
0answers
130 views

Queue “Failed”, with Attempting to save an element in an unsupported site

I have many sites for different countries and languages. They are grouped by language. I have a matrix field setup to "Save sites to other sites in the same site group". We imported all the sites ...

1
2 3 4 5
12