HansSchouten / PHPageBuilder

A drag and drop page builder to manage pages in any PHP project
https://www.phpagebuilder.com
MIT License
706 stars 178 forks source link

Update my settings based on how many elements are inside the block #189

Open Daniel-Fo opened 2 months ago

Daniel-Fo commented 2 months ago

I am trying to create a block which has a button or dropdown that lets you add or select how many items are in the block. How can i dynamically update my settings folder to create new fields for these new items.

For example: I have a block that contains 4 images that are displayed in a standard bootstrap grid, in the settings i have a url input for each image's url.. I have a button that when pressed it adds a 5th image to the block, I would need it to also create a 5th input to take the url for the new image. It should dynamically let me add and remove images and their urls.

I am able to create the button/dropdown but my issue is dynamically creating new fields.

Thanks