Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
3989 Visualizzazioni

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!

Avatar
Abbandona
Risposta migliore

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

Avatar
Abbandona
Risposta migliore

How can i create the template on odoo? 

Thank you

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
set 24
1332
0
dic 22
1771
0
giu 22
328
0
giu 21
2375
9
lug 20
10507