Edit "Who Can Post" selection field
Hi, I'd like to remove some options from the "Who Can Post" selection field in the "Create Group" form, but I can't find it in the form module nor in other modules... where should I check?
-
-
·
LeonidS
- ·
Hello Leonardo Zen !
Well, the privacy fields are the system fields and can't be simply controlled in Forms app. So it's better to place the raw block on the "Create Group" page with the following content:
<script language="javascript">
$(".sys-privacy-group option[value=8]").remove();
</script>
It is more stable way.
-
·
LeonidS
-
- · Leonardo Zen
- ·
Thank you, this removed one option (I guess the one with value 8)... But how can I know the value of the one I want to remove?
-
If you use Google Chrome then you may hover the cursor to the select field and press the right click of the mouse button. In the appeared menu you need to choose the "Inspect the code" menu point. In the appeared bottom panel (see screenshot 1) you need to expand the "select" field's variants (screenshot 2). There you will see the option values.
-
- · Leonardo Zen
- ·
Thank you, it worked.
And, is it possible to allow people create groups only if the group name hasn't already been used for another group?
-
If you want to have the groups without repeating names then you need to go to Studio->Forms->Groups->Groups area, choose the "Add group" display, click "9 fields" link (by default) and edit the "Group Name" field. In the appeared popup enable the "Unique" parameter.
-
- · Leonardo Zen
- ·
Thanks
-
- · Genesis
-
·
In reply to LeonidS
- ·
Which option and value is for "closed" and "secret" for groups, events, orgs, spaces, etc?
Also, how do I set it for only certain fields? For example, on the create profile page, there are multiple visibility fields such as "who can contact me", "visible to", etc. The idea is for the admin to control which visibility is available for the person to choose from, for each individual field.
-
- · Genesis
-
·
In reply to Genesis
- ·
Also, how do I remove more than one? Do I copy the code multiple times? I want to remove 2,5,6,7,8 and closed and secret.
-
- · Genesis
-
·
In reply to LeonidS
- ·
I also need to stop people from sharing to individual friends, and the persons list, etc.
-
-
·
LeonidS
- ·
Yes, due to editing I inserted the code with the old variables name in the one place. This one works:
<script language="javascript">
const aVars = [2, 5, 6, 7, 8, 'c', 's'];
aVars.forEach(reduce_vars);
function reduce_vars (sItem)
{
$(".sys-privacy-group option[value=" + sItem + "]").remove();
}
</script>
-
·
LeonidS
-
- · Genesis
-
·
In reply to LeonidS
- ·
Thanks, but how do I also remove these in the images, from the context post block on the homepage? "persons" and "friend"
-
-
·
LeonidS
-
·
In reply to Genesis
- ·
Then JS array will have a look like:
const aVars = [2, 4, 5, 6, 7, 8, 'c', 's'];
6 is laready a value for the "Selected friends" option.
-
·
LeonidS
-
- · Genesis
-
·
In reply to LeonidS
- ·
I still shows up. I think it's different. 6 doesn't remove it. It's in the list with "group", "friend", "space" in the apps like albums. In the timeline, it says "persons" instead of "friend". 6 is for "selected friends".
Here's two more screenshots.
-
-
-
·
LeonidS
-
·
In reply to Genesis
- ·
If you need to hide the freidsna dn persons variants then the code in the RAW block will have the next view (but the "Asynchronous Mode" for the "Create Post" block should be disabled):
<script language="javascript">
const aVars = ['PERSONS', 'FRIENDS'];
aVars.forEach(reduce_vars);
function reduce_vars (sItem)
{
$(".sys-privacy-group").children().remove('optgroup[label=' + sItem + ']');
}
</script> -
·
LeonidS