When using the General link with search field in the Experience Editor, a user is not able to search for an item to use as a link, because the Search for a link functionality is not supported.
As an alternative solution, consider one of the following options:
- Use Edit the related item functionality when editing the necessary link fields.
- Perform the following steps to customize the modal window. Note that code is provided as a sample only (no testing has been done).
- Navigate to the Website\sitecore\shell\Applications\Dialogs folder, create a new folder and name it SearchLink.
- Copy the contents of the GeneralLink folder into it. Rename the copied files from GeneralLink to SearchLink.
- Open SearchLink.xml and add the necessary XML controls to it and change the code behind. Check the necessary structure for the search functionality in the Website\sitecore\shell\Applications\Buckets\BucketLink.xml.
Use the attached sample SearchLink.xml as an example when necessary.
- Customize the GeneralLinkForm class to extend it with search-related logic. Check the attached SearchLinkForm.cs file with the class for the custom modal window as an example. You can get acquainted with both the functionality of the GeneralLink form and added functionality for searching links while examining it.
- Make your custom command class based on the Sitecore.Shell.Applications.WebEdit.Commands.EditLink. The only change you have to perform is to change the following line:
urlString["xmlcontrol"] = "GeneralLink";
in the Run() method to the following one:
urlString["xmlcontrol"] = "SearchLink";
- Use your command class and custom form class to build an assembly, add the assembly file to your Website\bin directory.
- Open the Website/App_Config/Include/Sitecore.ExperienceEditor.config file, look for the following line:
<command name="webedit:editlink" type="Sitecore.Shell.Applications.WebEdit.Commands.EditLink, Sitecore.ExperienceEditor" />
and replace the value of the type attribute in the following way:
%your_namespace%.%your_command_class% , %your_assembly_name%