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

[DRY] Use html imports for the common header #4

Open
waldyrious opened this issue Oct 18, 2014 · 4 comments
Open

[DRY] Use html imports for the common header #4

waldyrious opened this issue Oct 18, 2014 · 4 comments

Comments

@waldyrious
Copy link
Owner

...and maybe templates for common structures, e.g. the content div, the footer, etc.

@waldyrious
Copy link
Owner Author

Won't do. Besides being fairly new in the browser landscape, it's too limited (only css and js get applied immediately). Ideally I'd like a way to replicate PHP's include(), so I could apply DRY in content as well (e.g. the container div, the common footer, the navigation menu). If we can include (and have them load automatically) images, videos, scripts and even markup documents like svg, why on earth can't we include html in the same manner? Sigh...

I'll close for now, but I'll update this issue if I come across any serious attempt at approaching that goal.

For now I'll bear repeating code in the spirit of allowing maximum portability (e.g. not needing a server for local development) but I suspect if html doesn't evolve to support this use case, I will probably have to return to PHP...

@waldyrious
Copy link
Owner Author

waldyrious commented Oct 25, 2014

Actually, there might be some light in the tunnel with seamless iframes. Let's just hope it doesn't take too long to arrive (caniuse?).

Web Components simply aren't meant for this, see e.g. what the spec says:

The template element is used to declare fragments of HTML that can be cloned and inserted in the document by script.

Anyway, this is a different issue from the one originally reported (common header can still be implemented with HTML imports), so I'll reopen and move that feature request (client-side static content embedding) to another issue.

@waldyrious
Copy link
Owner Author

waldyrious commented Nov 4, 2014

Not ready for prime time yet, reopened in a1711d7.

References:

@waldyrious waldyrious reopened this Nov 4, 2014
@waldyrious
Copy link
Owner Author

waldyrious commented Jul 23, 2016

Seamless was abandoned as well, god damn it!!

Perhaps iframe-height's approach could help a bit. Hope the specs eventually include something to properly embed html.

@waldyrious waldyrious changed the title use html imports for the common header [DRY] Use html imports for the common header Sep 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant