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

Make layout know if it's in error page or home page #948

hgl opened this issue Oct 20, 2019 · 4 comments

Make layout know if it's in error page or home page #948

hgl opened this issue Oct 20, 2019 · 4 comments


Copy link

@hgl hgl commented Oct 20, 2019

Is your feature request related to a problem? Please describe.
I asked this question on SO, but doesn't get much attentions.

I want to style the page differently in home and error page, but segment is undefined in both pagas.

Describe the solution you'd like
Either make segment return different values (e.g., "" vs undefined), or another variable saying if the current is error or not.

I lean toward the former.

How important is this feature to you?
Giving different layouts to home and error page layout is pretty common I think, and given there doesn't seem to be a workaround, I feel it's pretty important.

@pngwn pngwn added the proposal label Nov 19, 2019
Copy link

@intrikate intrikate commented Dec 11, 2019

On a side note, the page store from @sapper/app may offer a (slightly hacky) workaround. That being said, the problem surely seems common enough to warrant a better solution. I’d go as far as to say _error.svelte should not inherit the common layout by default (we can still import and use it explicitly if we want to).

Copy link

@silllli silllli commented Apr 28, 2020

There’s a pull request #962

@antony antony added the has pr label Apr 28, 2020
@Conduitry Conduitry mentioned this issue Jun 2, 2020
0 of 4 tasks complete
Copy link

@thebells1111 thebells1111 commented Jun 3, 2020

PR #1250 may be the solution to this. It separates the _layout styling from the _error styling.

@benmccann benmccann added this to Error handling in Roadmap Triage Aug 20, 2020
@benmccann benmccann linked a pull request that will close this issue Aug 26, 2020
0 of 4 tasks complete
@benmccann benmccann added error handling and removed has pr labels Aug 26, 2020
Copy link

@Conduitry Conduitry commented Sep 25, 2020

$page.error is now available in 0.28.9.

featherbear added a commit to featherbear/CTF2-client that referenced this issue Sep 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Roadmap Triage
Error handling
Linked pull requests

Successfully merging a pull request may close this issue.

8 participants
You can’t perform that action at this time.