People who code: we want your input. Take the Survey

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
2answers
19 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 ...
0
votes
0answers
15 views

Vanishing Matrix Blocks …

Odd issue cropped up on an older (3.5.19) project where client was disabling entries whilst editing and then when enabling the entry (via the Entries > Set Status in CP) any content matrix blocks ...
0
votes
0answers
24 views

How to import Category subfields within a Matrix block using FeedMe?

I'm importing Entries that have a Category field inside a Matrix block. My JSON includes data that I want to import directly to the Category subfields. Here's a simplified example of my JSON: { &...
1
vote
1answer
36 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
1answer
75 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
1answer
22 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
1answer
35 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 ...
1
vote
1answer
23 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 ...
0
votes
0answers
21 views

Admin Panel For Page Only Shows Disabled Matrix Blocks

I'm a Craft novice trying to help some people who have taken over a Craft 3 website. There is a Single Page where the Main Content is a series of Matrix blocks. The problem is the admin Control Panel ...
1
vote
1answer
57 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
1answer
58 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 ...
1
vote
1answer
28 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
1answer
43 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
0answers
11 views

Auto collapse craft commerce variant matrix

Is there a way to auto collapse Craft Commerce Variant Matrix Blocks? I work with many variants per product and it is very cluttered when expanded. I've already tried this way: Possible have matrix ...
0
votes
0answers
33 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
vote
1answer
22 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 ...
0
votes
0answers
28 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
1answer
23 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 ...
0
votes
0answers
31 views

Output Entry with Super Table, Matrix, Table for Element API

I'm trying to output a table within a matrix of a SuperTable for element API. I fail to output $projectList, I keep getting the error 'Invalid argument supplied for foreach()' or 'Trying to get ...
1
vote
2answers
66 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
vote
1answer
125 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
1answer
29 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 ...
0
votes
0answers
39 views

Add matrix block content to newly created Entry

Help. I feel this is almost basic and many have asked similar questions, but I cannot get this to work. I have an entry type which amongst other things has a Matrix field ph_selectorViews, which has ...
0
votes
0answers
58 views

Super Table Field error while editing the content

I have created a global field combined with Matrix and Super Table. Unfortunately getting error Return value of verbb\supertable\elements\SuperTableBlockElement::getContentTable() must be of the type ...
0
votes
0answers
9 views

Craft 2: edit a value in a matrix field

This should be fairly easy but I can't figure it out: $criteria = craft()->elements->getCriteria(ElementType::Entry); $criteria->section = 'news'; $entries = $criteria->first(); // a ...
1
vote
1answer
43 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 ...
0
votes
0answers
18 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 ...
0
votes
0answers
21 views

Find entries that use a specific block in their Matrix field

I am using this solution to get the latest article with a video. This works great, until I delete the Matrix block in my latest entry with video, then it still finds that entry, but without any data. ...
1
vote
2answers
28 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 ...
1
vote
1answer
124 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 ...
1
vote
1answer
28 views

Output of matrix field twice in one template

I have a matrix field with with multiple types. In a template I want to loop through all of the entries of that matrix field as you normally would. However, I also want to access a bit of data from a ...
1
vote
1answer
26 views

Problem with SUM on Matrix blocks

I have some Matrix blocks where I need to sum one of the fields within, but I only want to sum it when another field within that block is or is not empty. {% set reimbursementAmount = craft....
1
vote
1answer
18 views

Using Preparse field to display matrix blocks in Control Panel, limitations?

I can successfully use the Preparse field type to display matrix fields in the control panel, however, the output is very limited. Even my tag is stripped out. Is there any way to do this short of ...
1
vote
1answer
99 views

adding a block of matrix field from a front end entry form

I am trying to add a form to the frontend in which a registered user will be able to create and publish new block in a matrix field. I have read the documentation about it but am still failing ...
1
vote
1answer
87 views

Comparing matrix blocks by type and field value

I’m trying to do something, the answer to which should be as simple as searching a Matrix field value but that’s not working for reasons I can’t fathom. Setup I have a Matrix field called programme. ...
0
votes
0answers
47 views

How can I add data to a matrix field from a module without overwriting existing data?

I have an entry that has a matrix field. From a controller in a module I want to add additional data to it (e.g. some text that I have in a variable $messageText) but without overwriting the existing ...
0
votes
0answers
20 views

Optimising entries fetching in php

First of all, the last time I did php was 10 years ago in school, so I'm basically a noob :D I have two channels, let's say shops and products. Shops contains a matrix field composed of a product ...
1
vote
1answer
14 views

Using a Matrix field to create a homepage that shows entries from sections and categories

I have set up 3 channel types - A, B & C and a Category. Each entry type shares the same pool of categories. On the home page, I have created a Matrix field (homeSections) with a block type ...
0
votes
0answers
27 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 ...
1
vote
1answer
49 views

How to reset matrix field to have NO blocks in plugin?

I want to reset a matrix field to have no blocks in it. In a plugin, I would normally set a matrix field by doing something like this: $blocks = []; $i = 1; foreach ($itemsArray as $item) { $...
1
vote
1answer
52 views

Asset volumes with dynamic subfolder

I have an asset volume which uses dynamic subfolders on the field level. I have an assets volume called 'members'. In a matrix field on the user profile tab there is an image field that sets its ...
2
votes
1answer
46 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
29 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
63 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 ...
2
votes
1answer
44 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
12 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
20 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
46 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
1answer
35 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 ...
1
vote
1answer
45 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. ...

1
2 3 4 5
13