İçereği Atla
Menü
Bu soru işaretlendi
2 Cevaplar
3954 Görünümler

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
Vazgeç
En İyi Yanıt

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
Vazgeç
En İyi Yanıt

How can i create the template on odoo? 

Thank you

Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
1
Eyl 24
1300
0
Ara 22
1726
0
Haz 22
328
0
Haz 21
2316
9
Tem 20
10441