Hi,
How easy is it to add a drop down list to the toolbar via a plugin - more specifically a drop down list that is populated from a database (using ASP.Net)
I can handle the .Net stuff, but am unsure how to add the drop down list to the toolbar.
Any help would be appreciated.
Cheers,
Julian
How easy is it to add a drop down list to the toolbar via a plugin - more specifically a drop down list that is populated from a database (using ASP.Net)
I can handle the .Net stuff, but am unsure how to add the drop down list to the toolbar.
Any help would be appreciated.
Cheers,
Julian
RE: Adding Drop Down List into toolbar via pl
Hi Marcus,
THanks for that, although the link you give doesn't seem to work, but managed to run with this:
https://sourceforge.net/tracker/index.p ... tid=737639
I'm ultimately wanting to generate the items in the drop down from the database, but instead of having it paste code into the editor I want to use it to launch a dialog and then pass the selected item id along with the selected text from the editor to the dialog.
The functionality of the dialog will then be determined by the selected item id from the drop down.
The sample you highlighted should give me a good starting point, many thanks for that.
Cheers,
Julian
RE: Adding Drop Down List into toolbar via pl
Take a look at this plugin example:
https://sourceforge.net/tracker/index.p ... tid=737639
To customise it with items from the database you can use a javascript array that is generated server side and included into the parent document. Change the plugin script where the items are added to the combo to refer to the javascript array and load the items like this:
for (var i = 0; i < parent.arrSpecialLinks.length; i++)
this._Combo.AddItem(parent.arrComboItems[i][0], parent.arrComboItems[i][1]);
...and the array itself would be something like:
arrComboItems = new Array(
new Array('<a href="[subscriberupdate]" target="_blank">Item 1 text to insert</a>', '<span style="text-decoration: underline;color: #0000FF;font-size: 9pt;">Item 1</span>')
, new Array('<a href="[memberreferral]" target="_blank">Item 2 text to insert</a>', '<span style="text-decoration: underline;color: #0000FF;font-size: 9pt;">Item 2</span>')
);
I hope this helps.
RE: Adding Drop Down List into toolbar via pl
I have been trying your plugin with the older version of FCKeditor and it worked great.
I have just switched to the new Beta 2.3 and I have troubles. In Firefox I have the following error and I have no idea how to get rid of it:
FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(this.CommandName) has no properties
Can you help?
Thanks
RE: Adding Drop Down List into toolbar via pl
I to do had this prob with my custom plugin..it was fixed after i applied an ID on the form field
note: id="txtName"
<select id="txtName" name="txtName" style="WIDTH: 100%">
and in the js above it... (note the getbyid)
function Ok()
{
if ( document.getElementById('txtName').value.length == 0 )
{
alert( oEditor.FCKLang.DlgClassifyErrorName ) ;
return false ;
}
//oEditor.FCK.InsertHtml( '<a name="' + GetE('txtName').value + '"><\/a>' ) ;
oEditor.FCK.InsertHtml( '<b>'+ document.getElementById('txtName').value + '</b>  ' ) ;
return true ;
}
RE: Adding Drop Down List into toolbar via pl
Here is a full example of my plugin...in case it might not be clear
RE: Adding Drop Down List into toolbar via pl
RE: Adding Drop Down List into toolbar via pl
I had the same problem yesterday after upgrading to 2.3 Beta. It's pretty easy to fix.
After this line in the plugin:
this.Command=FCKCommands.GetCommand('mycombocommand');
add:
this.CommandName = 'mycombocommand';
I have updated the file attached to the Plugin (https://sourceforge.net/tracker/index.p ... tid=737639)
RE: Adding Drop Down List into toolbar via pl