Can someone help me

BattleKing

Spirit of darkness
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P Member
Collaborate
Registered
Joined
May 24, 2020
Messages
3,497
Points
523

Reputation:

Is it a node or a page or anything else you want to show to different users or groups ?
You can modify templates and set some statements to it.
 

QUASAR

Member
Registered
Joined
Nov 25, 2020
Messages
14
Points
3

Reputation:

Yes its a page, but i don't much know about coding..
Did you use conversations tools in your site ?
 

thomsa

Moderator
Staff member
Moderator
S.V.I.P Member
Collaborate
Registered
Joined
Jun 22, 2019
Messages
1,066
Points
173

Reputation:

Https://mysite.com/exampleurl/123/

How do I do this link that only the staff member can open it.
QUASAR
use /admin.php?user-groups/ set Yes for staff.

2021-04-09_12-51-19.png
 

BattleKing

Spirit of darkness
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P Member
Collaborate
Registered
Joined
May 24, 2020
Messages
3,497
Points
523

Reputation:

This is not what he want, he want to limit specific pages to be visible only for some users. I'll check later to demonstrate on how you can do that,I need to go to bed first
 

BattleKing

Spirit of darkness
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P Member
Collaborate
Registered
Joined
May 24, 2020
Messages
3,497
Points
523

Reputation:

You want to get it like that:

1617978333100.png


Left site has been opened by an admin, right site by guest, or user which is not in admin group. The title will be displayed, but the content is hidden.

To get this you need to know on what you would like to filter, so let's say you want to use the group to identify, and only moderator and admin should see that:

Admin has the group id 3
Moderator the group id 4

You will then open the ACP and goto Appearance -> Styles -> Default style -> Templates
Edit template: page_view

Add the following line at the top of that code, but please be aware that this is style dependent, which means you should test it for the style you are just changing. I use the Default Style:

Code:
<xf:if is="$xf.visitor.isMemberOf([3,4])">
Now we go to the end of the text and add the following:
Code:
<xf:else />
    <xf:title>{$page.title}</xf:title>
    <xf:description>Not allowed to view!</xf:description>
</xf:if>

That's it, this was quick and dirty, but demonstrate on how you can do it. This is for all pages, if you want to limit the access to specific pages, you need to add the page_id to the statement.

Important such kind of changes should be applied in a different way, like template modifications, so that this will be used by each style. If you want to know how to do it via template modification, let us know.
 
Last edited:

BattleKing

Spirit of darkness
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P Member
Collaborate
Registered
Joined
May 24, 2020
Messages
3,497
Points
523

Reputation:

@QUASAR I'm ok in receiving PM's but it would be better to ask the questions in the thread, so that each one get the answer. Let's see what you wrote, get back later to you
 

BattleKing

Spirit of darkness
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P Member
Collaborate
Registered
Joined
May 24, 2020
Messages
3,497
Points
523

Reputation:

don't do it via private messages this just help only one user and not the rest of the community
 

Warfare

[Your Welcoming Staff Member]
Staff member
Administrator
Moderator
+Lifetime VIP+
V.I.P Member
Collaborate
Registered
Joined
Apr 29, 2020
Messages
344
Points
103

Reputation:

@BattleKing is correct. Helpful things should be posted publicly as it helps the whole community.
 

sarvin_pakzad

программист и дизайнер
Collaborate
Registered
Joined
Nov 14, 2020
Messages
46
Points
18

Reputation:

Hum, ok guys @BattleKing @lucius

1. click edit your page.
2. use this code in "Template HTML" section :
HTML:
<xf:if is="{{$xf.visitor.isMemberOf(1,2,3)}}">

        your page content...

    <xf:else />

<p>you dont permission to view this page, please upgrade your account to see page content</p>

    </xf:if>

OR ------------

HTML:
<xf:if is="{$xf.visitor.is_staff}">

your page content...

</xf:if>
3. number of 1,2,3 in the number "2" is your user groups ID.

Good luck :) ;)
 
Last edited:

BattleKing

Spirit of darkness
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P Member
Collaborate
Registered
Joined
May 24, 2020
Messages
3,497
Points
523

Reputation:

@BattleKing I change it a bit:
and add it at the beginning of the template:

Code:
<xf:if is="!$xf.visitor.isMemberOf([3,4]) AND $page.node_id==6">
    <xf:title>{$page.title}</xf:title>
    <xf:description>Not allowed to view!</xf:description>
<xf:else />

the page id is called NODE_ID and can be found in the nodes section.
 

BattleKing

Spirit of darkness
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P Member
Collaborate
Registered
Joined
May 24, 2020
Messages
3,497
Points
523

Reputation:

I already add this some comments above, have you not checked the thread ?
Thx again for posting, it is better to get the answer multiple times than never :D
 

Warfare

[Your Welcoming Staff Member]
Staff member
Administrator
Moderator
+Lifetime VIP+
V.I.P Member
Collaborate
Registered
Joined
Apr 29, 2020
Messages
344
Points
103

Reputation:

Thank you both. It’s appreciated. Looks like it’s answered ??
 

sarvin_pakzad

программист и дизайнер
Collaborate
Registered
Joined
Nov 14, 2020
Messages
46
Points
18

Reputation:

Oh, sorry. i dont check the comments. :ROFLMAO:
 
Top