Questions tagged [matrix]

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

Filter by
Sorted by
Tagged with
3
votes
1answer
2k views

Object of class Craft\ElementCriteriaModel could not be converted to string

I have set up a Matrix field that contains a block type that contains among other things, an asset field. Trying to iterate through the contents of that matrix field works just fine for all other ...
2
votes
1answer
506 views

Can't add anymore fields / blocks to Matrix Field

I have a really big / flexible Matrix field for one of my websites. It works great and is easy to handle. The problem is that I need to add another block containing some fields. I already extenended ...
1
vote
1answer
188 views

How to render an entry type of a Matrix in HTML?

<a href="{{box.learnMoreLink}}"> {{ box.learnMoreText }} </a> Currently I have a Matrix field that has two plain-text fields. I want to change the href ({{box.learnMoreLink}}) from plain-...
1
vote
0answers
43 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 ...
1
vote
1answer
57 views

Accesing craft.categories.slug ids within a MatrixBlock for search query

I have a dropdown search query I have implemented using this blog (https://www.webstoemp.com/blog/combined-searches-and-filters-craft-cms) This works excellent for searching my three categories and ...
2
votes
1answer
131 views

Smart Map - Outputting locations from a Matrix field for all entries within a single section

I'm using the Smart Map plugin, and I can't seem to figure out how to output all the locations of my entries from a single section onto one single map. I think the issue I'm having is trying to get ...
1
vote
1answer
51 views

Adding a new block type to Matrix causes subfields and subfields of other block types to disappear

When saving a newly added block type with subfields to an existing Matrix, the subfields of the new block type are gone and also are the subfields of 6 of the last block types. The whole Matrix ...
1
vote
1answer
359 views

Matrix gallery with Imager plugin

I have a portfolio page for a client that has a simple two column grid of images. However, I'd like to set it up so that it creates responsive images via the excellent Imager plugin. I have the ...
2
votes
2answers
611 views

Sort entries by custom date in Matrix field / Super Table

I currently have numerous Super Tables with date fields inside and I am trying to get all table items to list themselves together in date order depending on what the user inputs. I have tried using ...
1
vote
1answer
284 views

Show all images from Matrix Block

I'm trying to bring in all images from a matrix field but I can only get it to work with first() or last() but obviously it only shows 1 image. I've found a few article explaining it but I can't ...
1
vote
1answer
47 views

Change which Matrix items displayed

I'm supposed to display the most recent 6 items from a Matrix field but provide a slider so that the user can navigate through them (hiding the ones on the left, displaying new ones on the right). I ...
1
vote
1answer
321 views

Neo plugin - Displaying an image from a Matrix field

I am using the Neo plugin in my project. I have made a Neofield article content with several block types in it. Amongst the block types that I have in it, is a gallery as well. Gallery block type has ...
1
vote
0answers
175 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 ...
0
votes
2answers
136 views

How to output Name in Matrix entries

I have matrix field set up, is that possible to output Name in Field Settings (refer to the handle: aggressiveBehavior)? Thanks
2
votes
2answers
388 views

How to delete Matrix fields in front end

I created a user profile page with Matrix field with assets, I found this thread and this thread about adding and updating Matrix field in the frontend. Does anyone know how to delete the Matrix field?...
1
vote
1answer
365 views

loop.last of a certain block type

What are I doing wrong here? I'm setting block types 'stripCustom' and 'stripShowroom' to 'stripBlock' {% set stripBlock = entry.contentImage.type(['stripCustom', 'stripShowroom']) %} Then in a ...
3
votes
2answers
663 views

After updating, getting “Could not resolve the subpath” error

After updating to 2.6.2973, saving any entry fails, resulting in an Internal Server Error: "Could not resolve the subpath '{slug}'". I've read the similar errors on here which trace back to Matrix ...
3
votes
1answer
143 views

Is there any way to group Matrix blocks in the control panel (see image)?

Sorry if my question seems incomprehensible, it's my first question here so please go easy on me :) !! I'd like to group the fields in the image in one drop-down menu where, if possible, I can add ...
1
vote
0answers
66 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 ...
1
vote
1answer
1k views

How to get Image/Asset URL in Matrix?

I have got a problem with an asset field in a Matrix in an _entry template. The Matrix is for a step-by-step feature. Each step has his own image. So the asset field in my Matrix calls: stepImage. ...
1
vote
1answer
95 views

Create filters from Matrix Blocks on entries or products

I have a range of products on a product collection page. Each product has a matrix block (ageRange) with a group of checkboxes (values 1-10). I am currently trying to get loop through all products, ...
3
votes
1answer
233 views

Categories within matrix for relatedTo

I have a matrix field with a category field. I need to group these matrix items by category and give them headings which I'll use for tabs. This is how I'd do it for entries but is it possible for ...
2
votes
1answer
409 views

Couldn't Save Field

I am editing an already existing field in Craft. When I go to save, I get an error message that says "Couldn't Save Field", and the block type is highlighted in red. The field type is a Matrix that ...
2
votes
1answer
82 views

How do you use 'if' to stop an empty Matrix block from displaying?

On a complex page, where there are different sections that need to be present in the template, but may not all have content added via Craft entries I need to stop the empty areas from being output (e....
2
votes
0answers
154 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 ...
4
votes
0answers
134 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 ...
1
vote
1answer
189 views

Use Matrix to let client add Bootstrap Accordian Items

I'm creating a careers page on a site I'm working on and the design is for the jobs to go in an accordian that will slide open on click. So I'm thinking that this would need to be a matrix block as ...
1
vote
1answer
40 views

Can I Create a Way for Users to Add Fields from the Dashboard and/or create Fields with Same Handle?

I'm trying to create a Matrix field containing plain text blocks of two kinds, one for providing Youtube video embed codes, and one for providing a description. What I want to know is, is there a way ...
1
vote
1answer
184 views

How Do I Restart an Entries Loop Once It Hits the Last Entry

So I've got a Matrix block that is pulling in some entries and I'm looping through the entries in that block in a template. I'm then pulling a text field from each entry and putting it onto a page. ...
1
vote
1answer
212 views

Creating a smart restaurant menu

I'm building a website for a restaurant and I wanted to make the back-end as easy to use as possible. So I thought of a system like this. Allergens - Contains name and icon Ingredients - Contains ...
1
vote
1answer
574 views

How would I pull in the first Matrix block including certain blocks only

I have a Matrix field setup. I want to be able to pull in the first Matrix block used to print a snippet, but only out of the blocks 'text' or 'textImage'. So the first one used, out of those two only....
1
vote
1answer
46 views

Matrix Field Integration

I'm just looking for a little guidance here. I have a decent grasp of the matrix field but the functionality I want exactly is causing me some issues. Im trying to setup a matrix field with the ...
0
votes
1answer
93 views

Commerce products in Matrix

I use Matrix to select products through a "Commerce Products" field type. In the template, the following code displays nothing (not even an error in devMode.) {% for block in entry.MatrixHandle %} ...
1
vote
1answer
47 views

How to skip fragments of code in Matrix?

I fell like I'm missing an obvious thing, how to end block before I will start the new one? {% for block in entry.myMatrixField %} {% if block.type == "heading" %} <h3>{{ block.heading }}&...
2
votes
1answer
655 views

Import-Export Matrixfield data

Have used the pretty neat Import and Export plugins from Bob Olde Hamsink. But, those two do not handle Matrix data. The question is basically: What is the 'most common way' to import and export ...
1
vote
1answer
401 views

Getting error: “Matrix do not have a method or closure named…”

I just playing first time with Matrix and can't figure whats wrong with this code, here's error code: Craft\MatrixBlockModel and its behaviors do not have a method or closure named "naglowekPowitanie"...
1
vote
1answer
266 views

Select dropdown linking to Matrix blocks

I need a little bit of assitance. I have a matrix block that outputs floorplans diagrams and it's specification per floor in a property (see screenshot attached below. I've got the matrix fields ...
2
votes
1answer
92 views

Matrix field containing asset field blocks entry editing

I am new to Craft CMS and am testing it. I encountered a problem. I have a matrix field, containing an asset field. When I add this matrix field to the page field layout, then visit single entry, ...
1
vote
1answer
97 views

How to approach a multi-level floorplan

On the property development website I'm building for an agency client it has a section on the individual property page that shows the floorplans for the building. Which has different amounts of levels ...
1
vote
1answer
823 views

Conditional check if Matrix block field is empty (no content)

I'm having a difficult time with what seems like a fairly straightforward problem: I'm listing businesses and their related hours of operation (days/times). I'd like to set up a conditional statement ...
2
votes
0answers
111 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 ...
1
vote
2answers
117 views

Start Matrix loop from item that contains todays day

I have a Matrix block weeklyMenuItems, each item in the block has a dropdown with days of the week (Monday, Tuesday etc). Each entry will have a Matrix block with 7 items, matching the 7 days of the ...
1
vote
1answer
141 views

Passing Matrix block to a macro

I want to fetch a specific block from a Matrix global then pass it through a macro which returns a response based on the block type. However, if I try to use slice the type doesn't appear to be ...
2
votes
3answers
389 views

Only executing if a matrix checkbox has a specific value

I currently have checkboxes in a matrix block that allow a user to select where an image will be placed in the layout (as a featured slider image and/or in an image gallery). I've gotten the slider ...
1
vote
1answer
66 views

loop trough whole array inside a field

I want to write an entire loop into a field like this: Obviously this is not working. What would be the correct syntax when twig is written inside a field? Also is there a name for the twig tags ...
1
vote
1answer
926 views

Checking if Matrix fields are empty or not?

In a Matrix field i want to check if block.logolink (simple text) OR block.logolinkDropdown (dropdown with empty field) are empty or not: {% if block.logolink or block.logolinkDropdown %} If i check ...
2
votes
2answers
680 views

Basic Bootstrap + Matrix Implementation

I've got a project where I'm trying to set up a basic page layout – header, body, footer. But I also want the option for a user to add an image or bit of content (let's call it a "sidebar") that ...
4
votes
1answer
551 views

Is it possible to find what Matrix Block aren't being used

I have a fairly large site with the main content on most pages driven by a Matrix field. That Matrix field has 15 or so different Blocks - we are now doing a tidy up on the site and going to try and ...
4
votes
1answer
2k views

How to: Flexible Twig Templates in Craft

I am just starting out with Craft CMS. What I see right now is a lot of static content in the html templates. Even in the demo. {% block content %} <h1>{{ entry.title }}</h1> {{ entry....
1
vote
1answer
29 views

How can I get spaces to render in my dropdown option label template call?

Example Let entry.dropdownOption.label = "option with spaces" {% for entry in entry.dropdown %} {{ entry.dropdownOption.label }} {% endfor %} renders as in my template: "optionwithspaces" How ...

1
3 4
5
6 7
12