Missing some Features #108
Replies: 3 comments 8 replies
-
@evwerkz Thank you for your feedback!
Box Config name: Repeater Example
handle: repeater-example
form:
fields:
extra_information:
type: repeater
form:
fields:
title:
label: title
is_enabled:
label: Enabled
type: switch
photos:
label: Photos
type: fileupload
mode: image With Model <?php
namespace OFFLINE\Boxes\Models;
use October\Rain\Database\ExpandoModel;
class RepeaterItem extends ExpandoModel
{
public $table = 'acme_blog_repeater_items';
protected $expandoPassthru = ['parent_id'];
public $attachMany = [
'photos' => \System\Models\File::class,
];
} And Provider \OFFLINE\Boxes\Models\Box::extend(function ($model){
$model->hasMany = [
'extra_information' => [
RepeaterItem::class,
'key' => 'parent_id',
'delete' => true
],
];
}); Works on my end: <div>
{{ d(box.extra_information[0].photos) }}
</div> What does not work for you?
This is a very niche requirement and probably won't be added to the plugin.
Page templates currently are not meant for this use-case. They provide simple starting points for creating new sites, but are not meant to transfer page data from one place to another. |
Beta Was this translation helpful? Give feedback.
-
I have added a built-in model to make the usage of repeater items easier: Available in v3.4.1 |
Beta Was this translation helpful? Give feedback.
-
And another thing when I call this.page.id in twig. I always get zero. How do I get the page ID of Boxes pages? For example, you need it to mark a page as active in Navi. |
Beta Was this translation helpful? Give feedback.
-
I'm missing an upload form by repeater. Mediafinder form works but i need title and description functions for images.
I try it to extend this:
Doc: https://docs.octobercms.com/3.x/element/form/widget-repeater.html#example-of-using-related-records
But it dost work.
--
Settings to allow adding limited same box.
Occasionally I want to allow a box only once per page.
--
The page templates are very cool. But I miss creating a templates or pages with content.
Problem, if you create some pages local. Later I do a same if the page go live.
Beta Was this translation helpful? Give feedback.
All reactions