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

milanblasko2844565
milanblasko2844565

HI, I have a question. Is it possible for only one record to be created in the plugin? So in the backend, when I click on the backend menu, I get a form and not a list of records.

Eoler
Eoler

milanblasko2844565 said: Is it possible for only one record to be created in the plugin? So in the backend, when I click on the backend menu, I get a form and not a list of records.

You can get creative with a settings model: https://octobercms.com/docs/plugin/settings

milanblasko2844565
milanblasko2844565

Thanks! And how I can show settings records in template file? I try insert as Record List but that return error

Type error: Too few arguments to function System\Behaviors\SettingsModel::get(), 0 passed and at least 1 expected

Eoler
Eoler

milanblasko2844565 said: Thanks! And how I can show settings records in template file?

Use Settings::instance() as (singleton) reference, then access its fields:

{{ settings.property_name }} (Twig)
{{ $settings->property_name }} (PHP)
milanblasko2844565
milanblasko2844565

Thanks! Can I ask you where I insert Settings::instance(). Sorry for asking but I beginner.

1-5 of 5

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