Popup-Maker icon indicating copy to clipboard operation
Popup-Maker copied to clipboard

Create default popup content groups using block patterns

Open danieliser opened this issue 5 years ago • 6 comments

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/

danieliser avatar Oct 27 '20 23:10 danieliser

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

fpcorso avatar Oct 28 '20 12:10 fpcorso

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

danieliser avatar Oct 29 '20 07:10 danieliser

@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/

fpcorso avatar Oct 29 '20 12:10 fpcorso

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.

danieliser avatar Oct 29 '20 16:10 danieliser

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 avatar Oct 30 '20 12:10 fpcorso

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

fpcorso avatar Dec 08 '20 14:12 fpcorso