hi there , i want to create a custom button, which lists up all internal sitelinks possible.
i have all sites&subsite in a database table, a pure PHP/mysql soltutio9n which delivers a select-list would be finished within less than an hour i guess.
Unfortunatly, i still have kind of a copy&paste-mentality concerning javascript (but the possibilities of the fck are going to stop that, soon...)
Does anyone know a good "tutorial" concerning creating custom buttons in/for FCKeditor?
thanks blake
i have all sites&subsite in a database table, a pure PHP/mysql soltutio9n which delivers a select-list would be finished within less than an hour i guess.
Unfortunatly, i still have kind of a copy&paste-mentality concerning javascript (but the possibilities of the fck are going to stop that, soon...)
Does anyone know a good "tutorial" concerning creating custom buttons in/for FCKeditor?
thanks blake
RE: create custom button
It's also easier to integrate. Just copy the default one for your language, modify as required, and edit the fckconfig.js to specify your browser instead of the default one.
We have done this, as well as building our own image browser to select from internally manages images instead of the standard filesystem image browser.
RE: create custom button
but in general its still the same question: i will have to insert a custom button wether it will be to the links browser or the "main-surface" of the FCK.
And that is where some sort of tutorial would come in handy...
RE: create custom button
No there's no inserting of a button to modify the link browser... just modifying the dialog itself and changing the location in fckconfig.js

However if you do want to create a custom button on the editor toolbar, you need to write a plugin. I'd suggest taking a look at one of the plugins here:
http://sourceforge.net/tracker/?atid=73 ... unc=browse
I don't think there is a full tutorial yet, but following the samples isn't that hard
Good luck
Ben
RE: create custom button
i guess modifying the dialog wont help: ive written short of a CRM myself, always starting the same same site (main.php) giving different values for site main.php?site=news , main.php?site=forum ...)
All possible sites are located in a DB-table, so there is no file i can "linkbrowse" to...
RE: create custom button
You can create your own link browser that presents a list of links based on whatever you like - eg. read from a database. This can be accessed from the normal link function of the editor.
1. Create your dialog that presents the links from the database using PHP. Lets assume you call it /linkbrowser.php
2. Edit fckconfig.js and change the "FCKConfig.LinkBrowserURL" line to:
FCKConfig.LinkBrowserURL = "/linkbrowser.php"
Now when inserting a link into the editor using the link dialog, you'll see a button that says "Browse Server". Clicking on it will bring up your special php page to enable you to select a database link.
In your PHP page, you can pass the selected URL back to the hyperlink dialog with this line of javascript.
window.top.opener.SetUrl( strURL ) ;
We've done exactly the same thing to enable our CMS users to select links from the CMS database instead of the file system.
RE: create custom button
thx!

sounds quit simple
grettings, blake
RE: create custom button
thanks bnoble,
adjusted filebrowser does work fine,
theres is only one think i still need help:
in the linkbrowser, thers a select-field "protocol"
it is pre-selected with "http://"
i want the select-field "protocol" to switch to the entry protocol: <other> automatically but i dont know how to respond to the field.
in my custom filebrowser.php i have tried:
window.top.opener.nameOfSelectField.value="<other>" ;
for nameOfSelectField i tried several sounds-like-it-might-be-the-right-one-variables what i found in several .js scripts, but that resulted in a total non working filebrowser.php
does anyone know how to preselect a dieferent value for the field "Protocol" from within the filebrowser?!
greetings, blake