This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

marzia
marzia

I have create my first plugin with builder (table, model, controller, ecc) and the list of items in the database is display in the backend menu. How can I add the "button column" in this elements ? Because in the controllers folder I only have this in the index.htm file: <?= $this->listRender() ?>

Thanks for support.

Last updated

Tschallacka
Tschallacka

browse with your editor to:

plugins/AuthorName/PluginName/Models/yourmodelname/columns.yaml

Add there the columns you wish to add

https://octobercms.com/docs/backend/lists#list-columns

bayram4ik
bayram4ik

There are no way to do that in Builder (yet). So you should manually add it to your columns.yaml file

marzia
marzia

ok, but how can populate the column? I would a different button for each element of the list. The final result is a button which delete the element.

Last updated

Dreqnoid
Dreqnoid

You can add an partial column type with an button for each action you desire.

like in you're columns.yaml

  • link:

      label: ''
      type: partial
     path: ~/plugins/author/plugin/models/modelt/_link_partial.htm
    clickable: false

    sortable: false Then create a partial _link_partial.htm with:

<a href="action/update/<?= e($record->id) ?>" class="btn btn-primary btn-sm">Update</a>

Last updated

1-5 of 5

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.