Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
3964 Widoki

Hi all,


Currently busy with building a website for our start-up and I am looking into making some of our pages only accessible to users that are logged in. I managed to do this via This page>Propterties>Publish>Visibility>Signed in. This works as intended, but right now, when you are not logged in, you only get to see the


403: Forbidden

The page you were looking for could not be authorized.


text, but this will be confusing for our customers. Is it possible that we change this text (or redirect to a login page) to make this more clear? If so, what is the best way to do this?


Thanks in advance!

Awatar
Odrzuć
Najlepsza odpowiedź

HI, 

You can customize the text or redirect the users to a login page when they encounter a "403: Forbidden" error message. 

Here's how you can achieve this:

<template id="inherit_403_page" inherit_id="http_errors.403">


  <xpath expr="//div[@class='container']" position="replace">    <h1 class="mt32">///ModifyHere//</h1>


    <p>You need to be logged in to access this page. Please <a href="/web/login">log in</a> or <a href="/web/signup">sign up</a> to continue.</p>


  </xpath>


</template>


In this example, we're creating a new template with the ID "inherit_403_page" and specifying the "inherit_id" attribute to inherit from the original template with the ID "http_errors.403". 

Make sure to update the `href` values in the `` tags with the correct URLs for your login and signup pages.

Regards

Awatar
Odrzuć
Najlepsza odpowiedź

How can i create the template on odoo? 

Thank you

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
wrz 24
1304
0
gru 22
1729
0
cze 22
328
0
cze 21
2330
9
lip 20
10446