Mercator
Mercator

I an developing a number of components and snippets. I have defined properties, such as

public function defineProperties() { return [

  'header' => [
       'title'             => 'Header',
       'description'       => "Header text",
       'default'           => "",
       'type'              => 'text'
  ],
  'body' => [
       'title'             => 'Body',
       'description'       => "Body text",
       'default'           => "",
       'type'              => 'text',
  ], ...

A couple of questions:

  • When I use "text", a popup window opens and text can be entered. I would like to use a rich text editor. Is that possible?
  • Is it possible to specify the media manager or alike as "type", so the user can select an image?
  • I would like the user to select a random number of images. Is it possible to have a repeated field ?
  • Instead of using the php code above to specify field values per component instance, can I use a YAML file?

Last updated

josipr9563914
josipr9563914

I am very new to the OctoberCMS and I was wondering the same myself. Is there some kind of a workaround or way to create reusable components which can contain exchangeable text, images? Something like the Paragraphs module in Drupal?

Thanks for any kind of advice!

Eoler
Eoler

josipr9563914 said: Something like the Paragraphs module in Drupal?

This is moderately complex example: https://github.com/liip/oc-blocks-theme
that uses only RainLab.Pages plugin and backend repeater widget groups:

1-3 of 3