8

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 }} {% endfor %}


5

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, and b) shares a relationship with the partner entry set to the current user's partner field, via a guestAllocation SuperTable field owned by the event ...


5

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 field. Craft's own relations service has special handling for Matrix fields, which we also need to make use of. Fortunately, Josh Angell (the star that he is) ...


5

$element = Craft::$app->getUser()->getIdentity()->priceTable->relatedTo([ 'targetElement' => $product->id, 'field' => 'product' ])->one() But to be honest your code in Twig should not work as expected since you only grab the query and modify it. Your output is your search criteria, not the value of an element.


4

With the supercool table maker you can create dynamic tables. Is this what you are looking for?


3

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 field. Entry Matrix Super Table Asset Field The owner of the Super Table field is the Matrix field. The owner of the Matrix field is the Entry.


3

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 the required information, as this is in fact the blocktype variable. {% set fieldHandle = 'mySuperTableField' %} {% set field = craft.fields....


3

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 == 'Dropdown' %} {% for option in field.settings.options %} Label: {{ option.label }} Value: {{ option.value }} {% endfor %} ...


3

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 field, having sub-queries to perform for relations (each row). You can now query fields just like Matrix: {% set reverseRelatedElements = craft.supertable....


3

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 the entry list displayed at /admin/settings/entries), not relational fields (such as Entries, which is what you're using in your SuperTable). The easiest ...


3

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 handle of my Super Table field), Element API returns the information for the fields within the Super Table. case 'twoColumnText': $SuperTableRows = []; ...


3

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 few times while editing content. On the other hand, there are ways to improve the front-end performance such as Eager Loading. You can approach this ...


2

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 need to loop through {% for block in row.superTableBlock %} I can't tell if you're looping through the inner Matrix field. Have you tried: {% for block in entry....


2

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.


2

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 using SuperTable. Take a look at this screenshot; this is how I would set up my matrix field to allow me to content manage a slider (using the field names in ...


2

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 = [] %} {% for row in entry.tests %} {% for cable in row.cables %} {% if cable.title not in filteredCables %} {% set filteredCables = ...


2

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 array. {% set tourDates = [] %} {% set artists = craft.entries.section('artists') %} {% for artist in artists %} {% if artist.tourDates %} {% for ...


2

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.


2

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 Entries field, or a Matrix field. I believe the reason for this is that this simply fetches the content from the actual craft_content table. Being complex (...


2

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 to use the first row as his/her column headings. I've found that it works quite well!


2

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 the array syntax


2

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 for each row {% for row in entry.superTableMatrix %} {{ row.matrix|length %} {% endfor %}


2

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() .section(['your-section']) .leftJoin('{{%supertableblocks}} as supertableblocks', '[[supertableblocks.ownerId]] = [[entries.id]]') .leftJoin('{{%...


2

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 it's needed. I haven't used Bootstrap JS packages for a long time, so I was a bit thrown by the amount of divs you have. (I use this accordion package for how ...


2

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 category group for your vehicles such as you already defined (the structure you mentioned) Add 2 fields to the assets volume: Vehicle (category field) Year (date ...


2

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="{{ padding }} {{ fontsize }}" id="{{ blockID }}"> <div class="{{ margin }}"> {# loop all of your super tables #} {% for row in ...


2

I got a solution! <input class="remove" type="hidden" name="fields[{{ fieldHandle }}][{{ row.id }}][type]" value="{{ blocktype }}"> So the output will be "1" if you change it to "0" and safe your page the row is deleted! Really simple.


2

Matrix fields in Craft are much more powerful than EE. In EE each Matrix row has a single set of fields available to it (a limitation of using a table-based UI). But in Craft you can set up multiple “block types” for a single Matrix field, each with a different set of fields. So you can manage your text and assets all with a single Matrix field, with Text ...


2

Not sure if this is the answer without playing, but try saving the plain text field before adding it to the super table: // Create the super table field $superTable = new SuperTableField([ 'name' => 'supertablefield', 'handle' => 'supertablefield', 'groupId' => 1 ]); Craft::$app->getFields()->...


1

You're essentially running into this bug: https://github.com/craftcms/cms/issues/16 It has been fixed for the upcoming Craft 3, but the fix was involved likely won't be backported to Craft 2.


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