Página 404 personalizada: existem plugins?

It seems that you need to develop a plugin to customize the 404 page.

Does anyone have an example of a plug-in that does that?

We’d love to (radically) change the 404 page, would be a shame if we’d develop a plugin if other have done so before :slight_smile:

6 curtidas

Bump! I’d like to hide some of the existing widgets and show a New Topic button.

I see that the 404 page title can be set via Settings > Customize > Text Content > [search for current 404 error text that is displayed] but more options would be nice!

1 curtida

Hello,

I am looking to personalize my 404 page due to the IPB to Discourse migration.
I would like to have a simple page with text.

What is the best option?

Thank you

1 curtida

Has anyone figured this out? The 404 template is handled by ruby, not by JS, which is weird.
Is there a way to make custom 404 hbs template and style it through theme?

1 curtida

I’m also looking for a way to customize the 404 page. One problem I’m having is that some sections of a forum are private. So when I link to it in chat or from another post, and the users aren’t logged in to the forum, it looks to them like I linked to a page that doesn’t exist. Users don’t like to think too much in general, so I think that many of them don’t pay attention to the “or is private” part of the “Oops! That page doesn’t exist or is private” message, because it looks like the page doesn’t exist.

What I would like to do is: if not logged in, and the page is a 404, then show the sign-up or log in form on top of the 404 page (without redirecting, since that might confuse search engines). If the user is logged in and they don’t have access, then the regular 404 page would be shown.

Does anyone know if there is a way to do that?

Enable the enhanced but secrecy leaking 404 page in your site settings.

Is the page supposed to look different? I just tried that on two sites, and I still what looks like the same error page:

I rebuilt the forum on one of them to be sure it wasn’t just a caching problem, and tried for private topics and for pages that weren’t found.

My settings look like this:

2 curtidas

Which “sections” are you linking to? Are you linking to a specific topic?

1 curtida

Yes, I’ve tried loading specific topics, posts, categories, and non-existent pages while not logged in, and I see that same page.

1 curtida

Vamos ver. Aqui está um tópico no meu Discourse auto-hospedado, na categoria Staff:

https://discourse.codinghorror.com/t/test-topic-for-close-states/3516

Quando o carrego com detailed 404 definido como false (o padrão), vejo

Ops! Essa página não existe ou é privada.

O que é o esperado. No entanto, quando altero detailed 404 para true, vejo a mesma coisa… houve uma regressão aqui @sam ou estou entendendo mal o recurso? :thinking:

Até fiz um rebuild só para garantir, mas o resultado é o mesmo. Acredito que, com detailed 404 ativado, eu esperaria ver

Desculpe, você não tem acesso a este tópico.

4 curtidas

Acho que a mensagem que você vê está correta, pois ‘staff’ é, em última análise, uma categoria privada, mas posso estar errado.

Não, a ideia é que você intencionalmente vaze informações neste caso com detailed 404; o tópico existe, mas você não pode acessá-lo por algum motivo.

3 curtidas

Acho que o @dan trabalhou nessa funcionalidade. Talvez, Dan, você tenha algumas ideias sobre o que está acontecendo?

3 curtidas

Mensagens detalhadas de erro #404 são exibidas apenas se o usuário puder fazer algo para visualizar o grupo, geralmente ingressando em um grupo (livremente ou enviando um pedido de adesão).

Neste caso, os usuários não podem ingressar ou enviar pedidos de adesão ao grupo @staff, o que explica por que a página de erro detalhada não é exibida. Estou pensando em adicionar um caso “else” quando o “404 detalhado” estiver habilitado, que exibiria

Oops! Essa página é privada.

em vez de

Oops! Essa página não existe ou é privada.

6 curtidas

Sim, a cláusula else é preferível aqui.

2 curtidas

Considere também adicionar um botão “Voltar” (window.history.back()) à versão do Ember da página 404, já que essa é a única ação sensata que as pessoas podem tomar neste caso.

2 curtidas

Isso já foi implementado. Acontece que o servidor já retornava 403; a diferença estava apenas na mensagem de erro.

3 curtidas

Excelente! Atualizei minha instância auto-hospedada e agora o tópico da equipe

https://discourse.codinghorror.com/t/test-topic-for-close-states/3516

retorna corretamente

Oops! Essa página é privada.

Com o 404 detalhado ativado, quando acessado no modo anônimo. Obrigado! :clap:

4 curtidas

Uma solicitação que recebemos frequentemente é que essa página mostre um botão de login nesses casos, já que fazer login poderia tornar o tópico acessível.

5 curtidas

Acho que é um pedido fantástico e sensato. @eviltrout, você poderia atribuir isso, se não for muito arriscado antes do lançamento?

6 curtidas