Skip to content
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

[Modal Layout Picker] Add support for Self-Hosted sites #2455

Closed
chipsnyder opened this issue Jun 30, 2020 · 4 comments · Fixed by WordPress/gutenberg#24027
Closed

[Modal Layout Picker] Add support for Self-Hosted sites #2455

chipsnyder opened this issue Jun 30, 2020 · 4 comments · Fixed by WordPress/gutenberg#24027
Assignees
Labels
Page Templates [Type] Enhancement Improves a current area of the editor

Comments

@chipsnyder
Copy link
Contributor

chipsnyder commented Jun 30, 2020

Is your feature request related to a problem? Please describe.

This task is part of the effort to rework the Starter Page Template Picker for new pages. On a self-hosted site as a user, I should be able to use the new layout picker utilizing the layouts that are currently provided in the existing STP picker.

Goals

  • On self-hosted sites, when creating a new page, a user should be presented with the layouts currently used by the existing SPT picker.
    + The format of the existing layouts should be modified to match the scheme as provided by /wpcom/v2/sites/{site}/block-layouts and copied to a place that is accessible by the apps.
    + Ideally these will be moved to a place that can be shared by both iOS and Android then served up through their respective Gutenberg Mobile libraries. However, there shouldn't be an excessive amount of time spent on that aspect. For the first version, we can duplicate the data and improve the reusability later if needed.
    + The existing SPT should still work when this feature is disabled.
    + This data can be used as the static data used to build the UI in [Modal Layout Picker] Create Layout Picker sections and thumbnail UI using static data #2436, and [Modal Layout Picker] Create Layout Picker category bar UI using static data #2437
  • The layouts for the self-hosted sites can be fetched from the public API https://public-api.wordpress.com/wpcom/v2/common-block-layouts

Additional context

Blueprint Flow - iOS
Blueprint Flow - Android
@chipsnyder
Copy link
Contributor Author

@iamthomasbishop @enejb
One thing I didn't investigate yet in regard to the self-hosted templates would be the preview images. I think we have everything else we need available in the template files but we don't have preview images yet. Is there a way we can generate these images or would we already have some anywhere we could use?

cc @antonis

@chipsnyder
Copy link
Contributor Author

chipsnyder commented Jul 10, 2020

Ideally these will be moved to a place that can be shared by both iOS and Android then served up through their respective Gutenberg Mobile libraries. However, there shouldn't be an excessive amount of time spent on that aspect. For the first version, we can duplicate the data and improve the reusability later if needed.

Looking into this in more detail; if we put this in a common JSON file then we'd open up the risk to miss some translations. For that reason, it will probably be best to duplicate the data in the native components. I would still suggest adding it to the Gutenberg Mobile libraries so that only repo needs to be touched when adding new templates.

Actually I should continue to investigate this. Testing the current picker it appears that the existing picker isn't translated either:

@chipsnyder
Copy link
Contributor Author

The endpoint for fetching the block layouts is configured to support localization by including the query parameter _localize.

To support that without duplicating the data natively, I think we would violate the goal of "there shouldn't be an excessive amount of time spent on that aspect."

So it seems like we'd want to create the meta-data in the iOS and Android native code and revisit a mechanism to share the data later.

@chipsnyder
Copy link
Contributor Author

This was closed by mistake from a partial PR merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Page Templates [Type] Enhancement Improves a current area of the editor
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants