Adding Items to Panels

There are two ways that you can add items into a panel.

You can manually populate items, either by defining them statically in your .yaml files, or by adding them dynamically in PHP.

Alternately you can use the db_items property to have them populated automatically from the database.

Code Names

All code names in Storekeeper, including item names, must be safe to put inside comma-separated lists and URLs. You may not use any special characters, including commas and the percentage sign.

If you wish to use unsafe or dynamic names, then you will need to use either the encode_id_column property or the encodeItemIdForStorekeeper() helper function to make them safe, and then the decodeItemIdForStorekeeper() function to restore them to their original values.

Client vs. Server Side

If you manually populate your panel's items, then the CMS will handle searching/sorting/pagination on the client.

If your items are automatically populated from the database, then the CMS will handle searching/sorting/pagination on the sever. Be aware that as pagination is happening on the server, you may not see every possible item at once in the items array.

Even if your items are automatically populated from the database, you may still customise and format them by looping through them in PHP in your fillOrganizerPanel() method.

Traits

Both items and item-level buttons can have traits.

These match up to each other, in that if a button has one or more traits then it will only appear when the selected items have the traits it does.

Reference for items: