I have added a dropdown replacing Target field's textbox in Hyperlink tab of RichText toolbar using Link.aspx
present at C:\Program Files (x86)\Tridion\web\WebUI\Editors\CME\Views\Popups\Link
. The Dropdown is coming in the UI of Tridion.
I want to populate the Linked Component Templates in that dropdown according to the component selected, but I am unable to populate the Component Templates in this dropdown.
I used UI Extensions for this (JS and Config files added). I have added it to the system.config
and created a virtual folder in IIS too.
I think I'm making some mistake in the Config file, as I am unaware of how many of it's tags should be used.
<?xml version="1.0"?>
<Configuration xmlns="http://www.sdltridion.com/2009/GUI/Configuration/Merge" xmlns:cfg="http://www.sdltridion.com/2009/GUI/Configuration" xmlns:ext="http://www.sdltridion.com/2009/GUI/extensions" xmlns:cmenu="http://www.sdltridion.com/2009/GUI/extensions/ContextMenu">
<resources cache="true">
<cfg:filters/>
<cfg:groups>
<cfg:group name="Extensions.Resources.NamedTargetDropdown" merger="Tridion.Web.UI.Core.Configuration.Resources.CommandGroupProcessor" merge="always">
<cfg:fileset>
<cfg:file type="script">/Commands/CT_Dropdown.js</cfg:file>
</cfg:fileset>
<cfg:dependencies>
<cfg:dependency>Tridion.Web.UI.Editors.CME</cfg:dependency>
<cfg:dependency>Tridion.Web.UI.Editors.CME.commands</cfg:dependency>
</cfg:dependencies>
</cfg:group>
</cfg:groups>
</resources>
<definitionfiles/>
<extensions>
<ext:editorextensions>
<ext:editorextension target="CME">
<ext:editurls/>
<ext:listdefinitions/>
<ext:taskbars/>
<ext:commands/>
<ext:commandextensions/>
<ext:contextmenus/>
<ext:lists/>
<ext:tabpages/>
<ext:toolbars/>
<ext:ribbontoolbars/>
</ext:editorextension>
</ext:editorextensions>
<ext:dataextenders/>
</extensions>
<commands>
<cfg:commandset id="Tridion.Cme.Views.NamedTargetDropdown">
<cfg:command name="NamedTargetDropdown" implementation="Tridion.Cme.Views.Link.NamedTargetDropdown"/>
<cfg:dependencies>
<cfg:dependency>Extensions.Resources.Base</cfg:dependency>
</cfg:dependencies>
</cfg:commandset>
</commands>
<contextmenus/>
<localization/>
<settings>
<defaultpage/>
<navigatorurl/>
<editurls/>
<listdefinitions/>
<itemicons/>
<theme>
<path/>
</theme>
<customconfiguration/>
</settings>
</Configuration>
and the JS, I have written is:
Type.registerNamespace("Tridion.Cme.Views");
Tridion.Cme.Views.Link.NamedTargetDropdown = function Tridion.Cme.Views.Link$NamedTargetDropdown() {
Type.enableInterface(this, "Tridion.Cme.Views.Link.NamedTargetDropdown");
this.addInterface("Tridion.Cme.View", ["NamedTargetDropdown"]);
};
Tridion.Cme.Views.Link.NamedTargetDropdown.prototype.isAvailable = function NamedTargetDropdown$isAvailable(NamedTarget) {
return true;
}
Tridion.Cme.Views.Link.NamedTargetDropdown.prototype.isEnabled = function NamedTargetDropdown$isEnabled(NamedTarget) {
return true;
}
Tridion.Cme.Views.Link.NamedTargetDropdown.prototype._execute = function NamedTargetDropdown$_execute(NamedTarget) {
var p = this.properties;
var previewItem = $models.getItem(p.itemId);
if (previewItem && Type.implementsInterface(previewItem, "Tridion.ContentManager.VersionedItem") && previewItem.isVersion()) {
var itemId = previewItem.getVersionlessId();
previewItem = $models.getItem(itemId);
}
if (!previewItem) {
return;
}
p.templateList = previewItem.getListComponentTemplates();
}
update
I think I need to add:
<ext:contextmenus>
<ext:add>
<ext:extension name=”NamedTargetDropdown" assignid="NamedTarget">
<ext:menudeclaration externaldefinition=”">
<ext:command>NamedTargetDropdown</ext:command>
</ext:menudeclaration>
<ext:dependencies>
<cfg:dependency>Extensions.Resources.NamedTargetDropdown</cfg:dependency>
</ext:dependencies>
<ext:apply>
<ext:view name=”PopupsView"/>
</ext:apply>
</ext:extension>
</ext:add>
</ext:contextmenus>
But upon adding this I am getting the following error:
Loading configuration file "C:\Program Files (x86)\Tridion\web\WebUI\Editors\NamedTargetDropdown\NamedTargetDropdown.config" failed: Invalid character in the given encoding. Line 30, position 21
"
double quotes instead of the”
"curly" version.