Skip to content
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.

Implement a theme fallback strategy #12

Open
goblindegook opened this issue Sep 30, 2014 · 6 comments
Open

Implement a theme fallback strategy #12

goblindegook opened this issue Sep 30, 2014 · 6 comments
Assignees
Milestone

Comments

@goblindegook
Copy link
Member

What happens when Google tries to crawl a site that uses a B3-based theme? What if a user's browser doesn't support JavaScript?

The theme should be able to detect these situations and serve the user/crawler a server-rendered version of the page. This can be done by:

Rendering the B3 application using Phantom.js

  • Pro: Visual fidelity.
  • Con: Requires Node.js on the server. While it's the best possible solution, this requirement alone makes me not want to go this route, since it severely hampers compatibility, ease of use and, ultimately, adoption.
  • Con: Anything not available on page load (as a result of further on-page interaction, timed events, etc.) may not be displayed.

Serving the content using a secondary theme

  • Pro: No extra dependencies, WordPress handles theme switching.
  • Pro: Fallback is possible using the theme's own PHP resources, it's not necessary to install a second theme for this.
  • Con: Unless the secondary theme is custom-built to look the same (read: extra work), the page will not match the B3 application's visual style.

Keeping a single theme, but reusing some components

  • Pro: We may be able to reuse WP API models.
  • Pro: We may be able to render the same Dust templates on the client and the server.
  • Con: Everything in between (views, custom helpers, controllers, etc.) has to be duplicated, in PHP and JavaScript.
@goblindegook
Copy link
Member Author

This hasn't been updated in 2 years, but it's something:

http://cretz.github.io/dust-php/

@pcruz7
Copy link
Contributor

pcruz7 commented Oct 9, 2014

That is definitelly a better approach...

@goblindegook
Copy link
Member Author

There's more to the frontend than just the templates, though.

@pcruz7
Copy link
Contributor

pcruz7 commented Oct 9, 2014

such as the custom helpers?

@goblindegook goblindegook added this to the 1.0 milestone Nov 1, 2014
@goblindegook
Copy link
Member Author

I somehow missed this, and its very good news:

http://googlewebmastercentral.blogspot.pt/2014/05/understanding-web-pages-better.html

@goblindegook
Copy link
Member Author

Saving this for future consideration: http://php.net/manual/en/book.v8js.php

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants