-
Notifications
You must be signed in to change notification settings - Fork 384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AMP Stories] Research Reusable Blocks as they pertain to templates #1982
Comments
Notes from looking into reusable blocks for using templates, and looking into how other plugins that are using templates / template-like blocks. On reusable blocks: If we are looking to create predefined templates that would be static and always available then reusable blocks aren't necessarily a good solution for the AMP Story templates. Other plugins Plugins checked:
Design plugin: These templates or predefined sets of blocks are available in the Plugin Sidebar (right sidebar in the editor). Otter plugin: The Ultimate Addons Plugin: Potential implementation for templates for AMP Stories.
For example, we could rename the current "Page" block to "Blank Page" and then add (under relevant categories) other blocks, such as "Travel Map Page", etc.
For example, when the user first creates a new Story then the user could be asked if to start the AMP Story based on For asking the user which templates to choose there are different options, among others:
Thoughts? |
Thanks for looking into this!
I feared as much :/
I guess at some point we'd want to make these extensible, but a list of templates stored somewhere in a file is probably the most straightforward solution. Templates will be created using the existing stories editor, from where we can use the resulting serialized HTML, plus a decent preview image. When you select a template, the serialized HTML is parsed and the resulting blocks are inserted on the page. After that, you should be able to customize the blocks just as if you built the page on your own. (see #1902) NB. This might involve uploading images from the template to the media library as well, not sure.
I think we have explored this already a bit in the mockups. On a fresh post with an empty page, there should be a button to select the template. Also, the inserter in the top right corner of the editor area would be modified to show a list of templates to choose from, in addition to a "Blank Page" template. We can further discuss the UX part with @dawidmlynarz on Slack. |
Do I understand correctly that you're thinking that we could manually create the templates (using the editor) and then use the HTML of those blocks to create static templates for the users? |
I think so, yes. |
Based on our last discussion it seems like we are looking for an experience where the editor would have some static templates available (either multiple pages or single page templates or both) and in additionally they could use reusable blocks to create their own templates. For the static templates we could use a modal as shown in the mockups, probably it would be ideal if the user saved templates would also appear there, under a different category for example. Considering the timeframe we have then perhaps we could approach the templates as a step-by-step iterative process and break it into different issues? For example, the first step could be just the single-page static templates, the second step could be adding reusable blocks which would also be pulled into the templates interface, the third step could be adding multi-page static templates (which likely wouldn't be technically more complicated than single-page but would take some time to think through the preview and creating the templates from a Story / UX perspective so that they would make sense to the editor). This way we can continue the discussion and figuring the best way out while we're already building the first part of it and would ensure that we have at least part of the templates working well in time. Let me know if breaking the templates into different tickets/iterations makes sense to you. |
Oh yes, totally needs to break it down into smaller, more actionable issues. So far we only have #1902. But there need to be issues for finalizing the templates, actually creating them (using the editor), the functionality to insert them into the editor, etc.
There's also an inserter component in the mockup that includes a search form. I think that one would make sense as well from a user perspective, as it's closer to the existing insertion UI in the block editor. |
Agreed, especially if we have a lot of templates or if the user can add their own templates. How about the following issues? Breaking this out now will make it easier to discuss each part under the relevant ticket, e.g. missing blocks, the approach for reusable blocks, etc. For the basic static templates, first step:
For the reusable blocks, second step:
For when we still have time after the reusable blocks:
Some of these already exist as notes, I can convert those to issues for enabling discussion. Thoughts? |
SGTM! |
What if the templates provided by the plugin don't work for me? What if I want to change something about them? Or what if I don't want all of the templates and I want to remove some? Those all seem valid to me. There could be a way to re-import reusable block story templates in case the user needs to go back. I like that with reusable blocks there is a clear mechanism for users to add their own templates using the existing infrastructure. But I see you're still suggesting to use reusable blocks for user-generated templates, so I think we're on the same page. |
If the user would want to change something about the templates it would, for example, be possible to add a template, modify it, and then save as a custom template (reusable blocks). Do you think that would make sense? In case of wanting to remove some: one option could be to use similar logic as there is for managing blocks now: WordPress/gutenberg#14224. Initially, we could just add a checkbox "Hide default templates". Do you think this would make sense from UX perspective? |
Let's sync before making a final decision on the path to be followed. The fact that reusable blocks can be modified or removed may not be a good enough reason to discard their use for implementing templates. Even if we have other options, reusable blocks still may be a good use case. |
Yes; that makes sense. That would satisfy both having a set of fixed templates, and also provide the flexibility of reusable blocks for user-generated templates, or modifications to the static ones.
This part I am not sure. If we give the user the ability to remove static templates, then why not having them as reusable blocks to begin with? |
Yes, that would be fine. Only slight painpoint would be the potential for templates being listed which I don't want anymore.
I suppose there'd either be a checkbox to hide the defaults or for there later to be a button to restore the default templates. I'm not sure which is better. My guess is that a user would more frequently want to modify a default template for their needs, and that they would rarely need to re-import the original story templates. So personally I think it would be better if everything was a reusable block and then if the user messes up the story templates and wants to get them back, they can just click the “Manage All Reusable Blocks” link in the inserter: And then they can be taken to this admin screen where we could have a new button to Re-import Story Templates like: Aside: If a user tries to open one of the reusable blocks there to edit, they'd probably get an error because they'd be trying to edit story blocks outside of the |
It could be a Toggle for hiding the default templates, e.g. if the user is working on a Story and has created a bunch of templates to work with and the Template Inserter is overloaded with all the templates, then the user might click "Hide default templates" for "cleaning up" the Inserter view. However, when the user would then start another Story and would want to see the default templates again as a starter, "Hide default templates" could be turned off to choose from examples. This way the user can hide the default templates but doesn't lose these in case of starting a new Story and needing those again. (Just an idea, I don't feel necessarily strongly about it.)
Sure, that's fine, too. Maybe the link for managing templates could be in a more accessible place to make it more intuitive. Also, the user should probably be able to filter the Reusable Blocks then by templates and "normal" reusable blocks? I'm a little bit concerned about making the process confusing for the user, maybe there is a way to simplify it, e.g. if everything would be linked from the editor's templates modal ( edit / remove icons per each template preview which would then directly link to the right page instead of the list view of Reusable Blocks). Thoughts? Re-Import would then add the default templates again in addition to the already existing ones, right? Or well, any template where the content isn't equal. |
Are you thinking that the user should manually import the initial default templates as well? Meaning that by default there would be no templates in the Template Inerter except for the Blank Page? |
Yeah, I don't know. Hiding the default templates doesn't seem so necessary. The user should know which templates they created so they should easily be able to identify which templates are the defaults.
That's right. It could just re-create reusable blocks for any that don't exist in identical form.
No. I think the default templates should be automatically inserted. But just that if they want to restore the initial default templates, they could do so via that screen. |
That might depend on how many templates we'd want to add by default 😄 |
Closing this issue since it looks like we have come to a conclusion and also planned Sprint 4. Feel free to open if it feels like we should discuss more. |
Understand the current state of reusable blocks, and what needs to be done to use them for Travel/Fandom templates.
Plan Sprint 4 Templates features.
The text was updated successfully, but these errors were encountered: