Jump to content

[Solved] TinyMCE in Blocks do not show image icon / functionality


herr rilke
 Share

Recommended Posts

Hello everyone,
I have the following fields: a TinyMCE and an image field. But when I select an image, I can't insert it into TinyMCE.
What do I have to do to make this work?

and (additional question): Tiny loads very slowly, it feels like 5 seconds after the rest of the editing mask is already displayed.

 

  public function migrate()
  {
    $rm = $this->rockmigrations();
    $rm->migrate([
      'fields' => [
        self::field_text => [
          'type' => 'textarea',
          'inputfieldClass' => 'InputfieldTinyMCE',
          'contentType' => FieldtypeTextarea::contentTypeHTML,
          'label' => 'Text',
          'rows' => 10,
          'icon' => 'align-left',
          'inlineMode' => false,
          // 'rpb-nolabel' => true, // hide label in backend
          // 'settingsFile' => '/site/modules/RockMigrations/TinyMCE/text.json',
          'settingsFile' => '/site/modules/RockMigrations/TinyMCE/full.json',
          'textformatters' => [
            'TextformatterRockFrontend',
          ],
        ],

        self::field_image => [
          'type' => 'image',
          'label' => 'Bild',
          'maxFiles' => 1,
          'descriptionRows' => 0,
          'extensions' => 'jpg jpeg gif png svg',
          'maxSize' => 6, // max 6 megapixels
          'okExtensions' => ['svg'],
          'descriptionRows' => 1,
          'icon' => 'picture-o',
          'outputFormat' => FieldtypeFile::outputFormatSingle,
          'gridMode' => 'list', // grid, left, list
          'required' => false,
        ],


      ],
      'templates' => [
        $this->getTplName() => [
          'fields' => [
            RockPageBuilder::field_eyebrow,
            'title' => [
              'label' => 'Headline',
              'icon' => 'header',
            ],
            self::field_text,
            self::field_image,
          ],
        ],
      ],
    ]);
  }

any help would be highly appreciated.

 

Link to comment
Share on other sites

Sorry, I still don't understand. But I do not let my clients add any pictures inside TinyMCE fields, true. When I need Image + Text for example, then I create a block Image + Text with one image field and one text field.

Link to comment
Share on other sites

ok, try my best:

i have two fields:

image.thumb.png.335152d5950f30967c5d285a38e01742.png

after uploading i am able to click the image icon in the editor:

 

image.thumb.png.3c4bac1b1c11efd770ed7fba69070a74.png

even edit the image:

image.thumb.png.80de3f036be35e06d4b798e2efae0e0a.png

 

 

 

and paste it into the text.

but of course i understand your approach as well.

so i go and do it your way 😉 

 

Link to comment
Share on other sites

Thx for the explanation!

A huge motivation of RPB was to get rid of the workflow that you show here, because in TinyMCE you have no control over how large your image is, what the final aspect ratio will be, etc, etc.

That can lead to severe design issues, for example because clients make it look nice on desktop, but they forget to think about all other screen resolutions.

With RockPageBuilder we as developers/designers take care of that and the client just uploads content and provides the text.

It's still not an easy to solve problem sometimes, but imho it's the better approach.

Link to comment
Share on other sites

Thank you Bernhard for clarifying your point of view again in such detail.
Ultimately, you are of course right and many editors actually no longer allow the insertion of images. When I sometimes look at the output, I understand exactly why 🙂

In this project I will have to administer large parts myself, therefore it could have been a short cut.
but then and for now - I'll have to do it "right" from the start. Since I can reuse the blocks, it will probably pay off

  • Like 1
Link to comment
Share on other sites

  • herr rilke changed the title to [Solved] TinyMCE in Blocks do not show image icon / functionality

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...