Jump to content

[Solved] Image Fields not initializing properly within 'add block to page'


iank
 Share

Recommended Posts

Hi @bernhard

Hope I can explain this well enough:  I have several RPB blocks that contain image fields (some are single image, others multiple images).  

I used your VScode snippets to create the image field in the block's $rm->migrate() method, e.g:

self::image => [
          'type' => 'image',
          'label' => 'Image',
          'maxFiles' => 1,
          'descriptionRows' => 1,
          'extensions' => 'jpg jpeg png',
          'maxSize' => 3, // max 3 megapixels
          'maxWidth' => 1200,
          'maxHeight' => 1200,
          'icon' => 'picture-o',
          'outputFormat' => FieldtypeFile::outputFormatSingle,
          'gridMode' => 'grid', // left, list
        ],

But when I then add a new block to a page from the admin,  it seems the image field isn't ready to accept images, either via the "Choose File" button, or via drag and drop.  In fact it looks like this:

imageField1.png.f4cd29814007e124fcc575a929f5b51a.png

The Choose File button allows the selection of a file, but nothing is uploaded, and dragging/dropping does nothing.  There are no JS errors in the console.

If however I save the page, the field seems to resolve itself and is then able to receive images:

image.png.7323b680a5d7312497dc61c285f5d5f4.png

I've tried various options, including saving the field again in the Admin, and copying/pasting the full RockMigrations Code from the field's Basics tab, but to no avail.

Have you any ideas?

Many thanks in advance,

Ian.

  • Thanks 1
Link to comment
Share on other sites

Hey @iank I just pushed the new version v5.0.0 to my website ? 

https://www.baumrock.com/releases/rockpagebuilder/

Please note that in this version I have changed the way how sorting blocks works. In the older release we had this icon, which opened a modal to sort the elements:

OLD way:

xqhOuFQ.png

2mqSAVH.png

The new way of sorting is Drag&Drop ??

mXZldQX.gif

I'll send out some more informations with the next Rock-Monthly soon! ? 

Thx for reporting the issue! I hope you like RockPageBuilder ? 

PS: Please make sure to also update RockMigrations + RockFrontend to the latest versions!

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

Hi @bernhard,

Many thanks.  Yes, the update to v5.0.0 has certainly fixed that issue.

21 hours ago, bernhard said:

I hope you like RockPageBuilder ? 

Yes, I definitely do ?

I like the drag 'n' drop sorting too, although it can be a little difficult to know whether you're dropping in the right place when you have blocks that are quite long on the page.  At least you can still do it the 'old' way as well, on the admin page edit screen.

Many thanks for the quick response!

  • Like 2
Link to comment
Share on other sites

  • iank changed the title to [Solved] Image Fields not initializing properly within 'add block to page'
On 1/4/2024 at 4:31 PM, iank said:

Yes, I definitely do ?

I like the drag 'n' drop sorting too, although it can be a little difficult to know whether you're dropping in the right place when you have blocks that are quite long on the page.  At least you can still do it the 'old' way as well, on the admin page edit screen.

Many thanks for the quick response!

Great to hear that ? Thx for marking the topic solved!

I've pushed v5.0.3 yesterday which brings back the old sorting icon in the top right corner additionally to the new drag&drop sort handle at the top left. I think, as you said, it makes sense to have both options!

  • Like 2
Link to comment
Share on other sites

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...