PopupMaker / Popup-Maker

Popup Maker plugin for WordPress
https://wppopupmaker.com/
104 stars 38 forks source link

Create default popup content groups using block patterns #893

Open danieliser opened 3 years ago

danieliser commented 3 years ago

Describe the feature request

Have a few common popup content sections, like 2 columns with bullet list and image followed by opt-in form, that are available for admins to quickly add.

Possibly using the block patterns system: https://developer.wordpress.org/block-editor/developers/block-api/block-patterns/

fpcorso commented 3 years ago

@danieliser With the new block patterns, do you think we would utilize these INSTEAD of the premade layouts (#655) or in addition to?

danieliser commented 3 years ago

@fpcorso I think that is duplicate of, but prior to the formalization of this API.

fpcorso commented 3 years ago

@danieliser Reviewing the docs and it seems the templates take arrays whereas the block patterns take a string of HTML in block form. The content string would get messy if we had a lot of blocks in the pattern whereas the template would just be more nested arrays. The templates can also be set as the default for custom post types (i.e. have a certain template all popups start with).

The big philosophical difference is that templates are used for default content to be built upon and the block patterns seem to be repeatable block groupings that can be inserted (similar to block groups I think). In terms of UI, I think it's just the block patterns that would show in the UI to be inserted but the templates would show within new content that is created.

I'll have to play with the current systems within the admin to see how they actually play out but I think it really depends on what we want to achieve. If we are going for XX different campaign types, each could have its own block templates to start with. If we are wanting to have some default groupings that can be inserted into different popup types, we might have block patterns there.

Realistically, I could even see us using both. But, right now, both issues just say to use the APIs but neither give a reason or use case so we would need to update accordingly.

Template docs: https://developer.wordpress.org/block-editor/developers/block-api/block-templates/ Block pattern docs: https://developer.wordpress.org/block-editor/developers/block-api/block-patterns/

danieliser commented 3 years ago

So then maybe we use block patterns for common popup content sections, like a 2 columns with bullet list and image, followed by optin form.

Otherwise your right I don't see needing both for use currently as popups are not long things that need lots of stuff usually.

fpcorso commented 3 years ago

Okay, I'll close the #655 for now then. If we decide to use templates in the future for something specific, we can create an issue for that specific idea then.

fpcorso commented 3 years ago

@danieliser Keeping this in 1.15 for now as, depending on how we implement the popup wizard (#686), we might use these content groups as the "templates". At least in the block editor.