This is not possible out of the box using a single template. If each site has their own set of templates then you can obviously set the source to the different RTE profiles for each site, but this still not solve the issue of restricting the to specific folders for media library or internal links.
You can override the default controls in /sitecore/shell/Controls/Rich Text Editor/InsertLink/InsertLink.xml
and /sitecore/shell/Controls/Rich Text Editor/InsertImage/InsertImage.xml
.
Within these you can manipulate the GUID
passed to the DataContext.
<CodeBeside Type="Sitecore.Shell.Controls.RichTextEditor.InsertLink.InsertLinkForm,Sitecore.Client"/>
<DataContext ID="InternalLinkDataContext" Root="{GUID}"/>
<DataContext ID="MediaDataContext" Root="{GUID}"/>
The current item is passed as a querystring parameter fo
which you can access from the code behind and use your own logic to set the correct root by overriding the InsertLinkForm
class. Unfortunately the current item is not passed to the InsertImage.xml control so need to pass through the context item id.
If you take a look at the JS for the InsertImage command located in /sitecore/shell/controls/Rich Text Editor/RichText Command.js
then this is the location that the link is generated. You can modify RadEditorCommandList["InsertSitecoreMedia"]
function to pass through the id in a similar way to InsertSitecoreLink
. The caveat here is I am using a slightly older version of Sitecore 7.2 in which there may have been an issue with Links/Media not remembering the user selection and opening in the same location. You may want to verify the id passed, if so you can use your own parameter.
Place the modified files in /sitecore/shell/Override
and Sitecore will use these instead.
This still doesn't help with custom RTE profiles per site and passing through the values but hope this helps.