Try our conversational search powered by Generative AI!

Per Nergård
Sep 20, 2010
  5340
(0 votes)

Manipulate user / group option in search user / group dialogs

I recently needed to block the user / group option in the membership dialogs to only have the group option.

I guess that it’s not a very common scenario but maybe it will be helpful to someone so here we go.

The search user / group dialog in edit mode is called MembershipBrowser.aspx and is located in the \Application\UI\Edit folder.

In admin mode the dialog is called SearchUsers.aspx in is located in \Application\UI\Edit folder.

To default the dropdowns and disable it was easy enough with some javascript.

Just add the code just before the last closing </asp:content> tag. Setting the selected dropdown to 1 means group and 0 users.

To get this to work in EPiServer you either make the changes directly in the files but that’s not recomended because they can be overwritten with a sp or so.

A better (but not great) way is to make copies of the files and add them your project and then use virtualpathmappings to redirect EPiServer to the new copies.

MermbershipBrowser.aspx

   1: <script type="text/javascript">
   2:         var dd = document.getElementById('<%=DropDownSecurityEntity.ClientID%>');
   3:         dd.options[1].selected = true;
   4:         dd.disabled = true;
   5:     </script>

 

SearchUsers.aspx

   1: <script type="text/javascript">
   2:     var dd = document.getElementById('<%=GroupSelection.ClientID%>');
   3:     dd.options[1].selected = true;
   4:     dd.disabled = true;
   5:     </script>
Sep 20, 2010

Comments

Sep 21, 2010 09:53 AM

I think that it is a best practise to use the VirtualPathMappedProvider to "replace" files in EPiServer CMS Edit Mode and Admin Mode.

Is the only bad reason, when using VirtualPathMappedProvider to replace things in the CMS, the fact that you create copies of the CMS files or are there any other drawbacks?

Sep 21, 2010 11:11 AM

No other drawbacks than that you make copies of the original files.

Sep 21, 2010 11:15 PM

Well, either way you do it you'll have to know about the changes done to the CMS files when you add a SP or upgrade, so it should not matter, but if you use VirtualPathMappedProvider you would likely have added your customized files to your project that usually store the sourcecode in a versioning system plus that you would be able ot see the files that have been replaced when you take a look in Episerver.config.

Please login to comment.
Latest blogs
Visitor Groups Usage Report For Optimizely CMS 12

This add-on offers detailed information on how visitor groups are used and how effective they are within Optimizely CMS. Editors can monitor and...

Adnan Zameer | Apr 18, 2024 | Syndicated blog

Azure AI Language – Abstractive Summarisation in Optimizely CMS

In this article, I show how the abstraction summarisation feature provided by the Azure AI Language platform, can be used within Optimizely CMS to...

Anil Patel | Apr 18, 2024 | Syndicated blog

Fix your Search & Navigation (Find) indexing job, please

Once upon a time, a colleague asked me to look into a customer database with weird spikes in database log usage. (You might start to wonder why I a...

Quan Mai | Apr 17, 2024 | Syndicated blog

The A/A Test: What You Need to Know

Sure, we all know what an A/B test can do. But what is an A/A test? How is it different? With an A/B test, we know that we can take a webpage (our...

Lindsey Rogers | Apr 15, 2024

.Net Core Timezone ID's Windows vs Linux

Hey all, First post here and I would like to talk about Timezone ID's and How Windows and Linux systems use different IDs. We currently run a .NET...

sheider | Apr 15, 2024

What's new in Language Manager 5.3.0

In Language Manager (LM) version 5.2.0, we added an option in appsettings.json called TranslateOrCopyContentAreaChildrenBlockForTypes . It does...

Quoc Anh Nguyen | Apr 15, 2024