Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2 Antwoorden
3956 Weergaven

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
Annuleer
Beste antwoord

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
Annuleer
Beste antwoord

How can i create the template on odoo? 

Thank you

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
1
sep. 24
1303
0
dec. 22
1728
0
jun. 22
328
0
jun. 21
2325
9
jul. 20
10444