跳至內容
選單
此問題已被標幟
1 回覆
3766 瀏覽次數

for example.some snippet content in website should only visible for portal user only after login.other content should be public,and other should be only for admin user

頭像
捨棄
最佳答案

Hi,

You could check the group of the user logged in in the snippet block. 

Eg:

<t t-snippet=“module_name.snippet_template_name”


    t-if=“request.env.user.has_group(‘base.group_portal’)” t-thumbnail=“thumbnail image link”/>


The above snippet block will only be available for portal user.

<t t-snippet=“module_name.snippet_template_name”


    t-if=“request.env.user.has_group(‘base.user_admin’)” t-thumbnail=“thumbnail image link”/>


The above snippet block will be available for admin user

Regards

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
5
1月 22
11825
3
3月 15
4571
1
5月 24
2505
0
8月 23
2448
0
6月 20
2642