Navigation Menu

Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

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

Closed
hgl opened this issue Oct 20, 2019 · 4 comments · Fixed by #1498
Closed

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

hgl opened this issue Oct 20, 2019 · 4 comments · Fixed by #1498

Comments

@hgl
Copy link

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
@intrikate
Copy link

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).

@silllli
Copy link

silllli commented Apr 28, 2020

There’s a pull request #962

@thebells1111
Copy link

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

@Conduitry
Copy link
Member

$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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Roadmap Triage
Error handling
8 participants