0

I've built a Custom Element called Contact and I've defined almost all the functions it needs including Contact::defineTableAttributes().

My question is two folds:

  1. How can I have my plugin install itself with a ready-made custom Field Layouts and their associated Fields.
  2. How can I display a SuperTable field, that includes multiple Email fields, in my Element's index page. Displaying the First Email field from the SuperTable is fine.

E.g.:

    protected static function defineTableAttributes(): array
    {
        return [
            'title' => ['label' => Craft::t('app', 'Title')],
            'type' => ['label' => Craft::t('app', 'Type')],
            'slug' => ['label' => Craft::t('app', 'Slug')],
            'postDate' => ['label' => Craft::t('app', 'Post Date')],
            'expiryDate' => ['label' => Craft::t('app', 'Expiry Date')],
            // SuperTableHandle.Field
            'emails.email' => ['label' => 'Email'],
        ];
    }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.