8 votes

Templating SuperTable

There's no block types with SuperTable, so no need to check that. Other that that it works just the same as Matrix fields. {% for row in superTableField %} {{ row.textFieldInSuperTableField }} {% ...
user avatar
  • 35.9k
5 votes
Accepted

How to query for multiple relations with SuperTable

It's a little hard to follow your example/description, but I'll take a stab at it. The way I interpret your question, you need to pull a single guestList entry that is a) related to the current event,...
user avatar
5 votes
Accepted

SuperTable and related entries

Unfortunately, you can't use Craft's built in relations service for reverse relations lookup with Super Table. This is because there's actually a special case for nested relations, such as a Matrix ...
user avatar
  • 3,402
5 votes
Accepted

How to get a Super Table relation in PHP?

$element = Craft::$app->getUser()->getIdentity()->priceTable->relatedTo([ 'targetElement' => $product->id, 'field' => 'product' ])->one() But to be honest your code in ...
user avatar
4 votes
Accepted

Adding Columns to a table

With the supercool table maker you can create dynamic tables. Is this what you are looking for?
user avatar
4 votes
Accepted

Editing SuperTable inside Matrix block

So you'll want to update the Super Table Block's content and to do that when in a Matrix field is a little tricky, but it can be done. $matrixBlocks = $entry->matrixField->all(); foreach ($...
user avatar
  • 3,402
3 votes

Dynamic upload location for Super Table within a Matrix field?

Have you tried using {owner.owner.slug}? If you've got Matrix > Super Table > Asset, and you're trying to get an attribute on the Entry/Element, you'll need to go two level out from the Super Table ...
user avatar
  • 3,402
3 votes
Accepted

Why is my Super Table field returning the ID for existing blocks?

I think the key thing here is that its a static Super Table field, which is treated differently to a repeatable one. Instead of looping through each block, there's only one. Fortunately, you have all ...
user avatar
  • 3,402
3 votes
Accepted

How can I loop through the values of a drop down within a SuperTable?

You'll likely want to do something like this: {% for fieldtype in blocktype.getFieldLayout.fields %} {% set field = fieldtype.field %} Handle: {{ field.handle }} {% if field.type == '...
user avatar
  • 3,402
3 votes
Accepted

Display entries by Category (Category in Super Table)

Not sure if you're still looking for an answer, but relation support has just been added to Super Table 0.3.7. Previously, relations wouldn't work with Super Table, as its a little bit of a special ...
user avatar
  • 3,402
3 votes
Accepted

How to show details on linked entry in CP (another field inside related entry)

Basically, what you want to do isn't possible – there's no hook for modifying the content in a relational field's input HTML. The getEntryTableAttributeHtml hook is meant for element indexes (such as ...
user avatar
3 votes
Accepted

Using Element API to output Super Table fields

Here is a solution I found. Define an empty array, then loop over it, providing whatever keys you want to return from the Super Table fields. Simply by looping over $block->columnTextBlocks (the ...
user avatar
3 votes

Craft 3 CP performance

Is this a problem with only the dashboard, or the front-end also? Although this is a bad answer, waiting a few seconds to load the dashboard shouldn't be a huge deal. You will only need to access it a ...
user avatar
3 votes
Accepted

SuperTable queries on fields in fields

I think I followed this breakdown, but a screenshot of the admin could be helpful as well if this answer isn't accurate... {% set speakers = entry.eventSpeakerList.all() %} {% for speaker in speakers ...
user avatar
3 votes
Accepted

Need to run the super table fix-content-tables from CLI

Under the hood, the Super Table fix is running a migration behind a controller, which you can call in a content migration directly in your project. I have done the same, due needing to script it in a ...
user avatar
  • 1,031
2 votes
Accepted

Matrix -> Super Table - > Matrix

Firstly, you'll need to change: {% for row in superTableBlock %} to {% for row in block.superTableBlock %} So you can reference the Super Table field within your out Matrix field. You also don't ...
user avatar
  • 3,402
2 votes

How to use Super Table to create an Image Carousel?

Welcome to Craft! Is it essential that you use SuperTable for this? The behavior you are describing is exactly what Matrix fields are designed to do, so you could quite easily achieve this without ...
user avatar
  • 3,604
2 votes
Accepted

Related Entry within SuperTable

You can’t use this special Twig function to get reverse related entries at all, as you’re not dealing with reverse relations in that context. From a stageEvent entry you can just loop through the ...
user avatar
  • 35.9k
2 votes

Can I eager load Super Table fields in a Matrix block?

This appears to have been added in the 0.4.7 release! View the original issue here. Note: I have not personally verified this functionality.
user avatar
2 votes
Accepted

Remove duplicated entries from SuperTable related entries

The simplest way is to create a "filtered" array, containing the unique cables, and then loop through that. For example: {# Build the "filtered" array of cables #} {% set filteredCables = [] %} {% ...
user avatar
2 votes
Accepted

Sort entries by custom date in Matrix field / Super Table

I did something like this as a workaround: Loop over entries, fetching all data you need and adding it to an array. Sorting that array with SuperSort and than displaying all info by looping over the ...
user avatar
  • 1,456
2 votes

Sorting SuperTable Field with SuperSort?

I think you need to add 'object' to your syntax if you're using {{ }}: {{ object.tourDates.tourDate }} Else it's { tourDates.tourDate } I believe. See the plugins docs under Advanced sorting.
user avatar
  • 1,456
2 votes
Accepted

SuperTable Field returning null

The reason the attribute for your Super Table is null is because the field is an element, which doesn't have 'simple' content. You'll find this is the exact same case for any other element like an ...
user avatar
  • 3,402
2 votes

Adding Columns to a table

I used the method described here: "A User-Friendly Table Field" http://www.drivesimplicity.com/blog/a-user-friendly-table-field -- instruct the user to leave columns that he/she doesn't want blank and ...
user avatar
  • 176
2 votes
Accepted

Is defined conditional passing, yet causes a "do not have a method or closure named" error

This is a weird twig behavior. You have to do if stRow['caption'] is defined to make it work because of the object syntax of twig. Sometimes the if defined statement becomes true when you don't use ...
user avatar
2 votes
Accepted

Matrix Field Count Records

You mean how many rows the table has? {{ matrixblock.superTableFieldHandle|length }} Or the number of blocks of a matrix field? {{ parent.matrixFieldHandle|length }} To get the number of blocks ...
user avatar
2 votes
Accepted

Entries query by Super Table field

It's basically the same as Find entries that use a specific block in their Matrix field? You can use the base query and left join your Super Table content row {% set entries = craft .entries() ...
user avatar
2 votes
Accepted

Bootstrap 4 Accordion with Matrix (and SuperTable)

I'd break up the forloops a bit so you're outputting the panel container and the accordion wrapper markup once. Then for each accordion (supertable row) you're outputting that markup as many times as ...
user avatar
  • 1,032
2 votes
Accepted

Craft CMS 3 data structure advice for vehicle make, model, trim, year tagging

Goal: Filter documents by related vehicle characteristics. My first idea would be to create it as such: Create an assets volume where all your documents will be uploaded to. Create a vehicle ...
user avatar
  • 1,456
2 votes
Accepted

Looping Related Entries with a Super Table

The issue is: you don't really loop your entries at all. {# get all super table rows #} {% set superTableRows = block.related.all %} {% if superTableRows is not empty %} <div class="{{ ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible