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

Always allow switching from Transitional to Native #2312

Closed
westonruter opened this issue May 14, 2019 · 4 comments · Fixed by #2550
Closed

Always allow switching from Transitional to Native #2312

westonruter opened this issue May 14, 2019 · 4 comments · Fixed by #2550
Assignees
Labels
P0 High priority
Milestone

Comments

@westonruter
Copy link
Member

If add_theme_support('amp', [ 'paired' => true ]) is present, then a user should still be able to still switch from Transitional to Native via the AMP admin screen, and back from Native to Transitional. If a site works in Transitional mode then by definition it should work in Native mode. But if paired => false (or paired is absent), then Native would be the only option, as the reverse is not true: if a theme only works in Native mode then it may be using AMP components in its templates (e.g. amp-sidebar) without any non-AMP version also implemented.

This will allow all Paired themes (e.g. Neve) to be also used in Native mode.

@amedina
Copy link
Member

amedina commented May 14, 2019

If a site works in Transitional mode then by definition it should work in Native mode.

I think the opposite is true: Native ==> Transitional; but Transitional does not imply Native.

@westonruter
Copy link
Member Author

I'm referring to the theme not to the site. If a theme is marked as being paired (transitional) then it is able to generate AMP pages as well as non-AMP ones. Therefore it should be able to switch from Transitional mode to Native mode. However, if it is not paired then it is not able to generate non-AMP pages, and thus it should not be able to switch from Native to Transitional.

Related to this is #2314 and whether AMP can be disabled for a given page/template. If a theme is not paired and yet it still allows AMP to be disabled, then that would imply it can actually still render non-AMP pages. In other words, such a theme is able to be used without the AMP plugin as a dependency. Such a theme could also presumably switch from Native to Transitional.

I think the opposite is true: Native ==> Transitional; but Transitional does not imply Native.

This is true at a site level when considering plugins.

@westonruter
Copy link
Member Author

Here's a plugin which forces Native mode even for themes that declare themselves as Transitional (paired=true): https://gist.github.com/westonruter/bf848ed3c8c922f192b6e2e39598e86c

@westonruter
Copy link
Member Author

westonruter commented Jun 11, 2019

Testing Instructions

  • Activate the Twenty Nineteen theme.
  • Switching between all three website modes should still be possible (Standard, Transitional, Reader).

And:

  • Install the Neve theme.
  • Be able to switch between Standard and Transitional mode, even though the theme is defined with paired => true. The Reader mode should not appear.

And:

  • Activate the “Force AMP First” plugin
  • You should no longer be able to switch the Website Mode.

@westonruter westonruter self-assigned this Jun 11, 2019
swissspidy pushed a commit that referenced this issue Jun 11, 2019
* Always allow switching from Transitional to Native on sites that are defined with `add_theme_support('amp', ['paired' => true])`. Fixes #2312.
* Restore suppression of validation error warnings appearing in Reader mode. Fixes #2311
* Add functionality for users to chose AMP + Stories, AMP-only, Stories-only. Fixes #2470
* Phase out “Native” terminology in favor of “AMP-first”. Fixes #2507.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P0 High priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants