Heiko H. wrote:I know ist's not perfect, feel free to use it, change it to your needs, or what ever...
Ich nehme mir das jetzt mal zu Herzen, insbesondere das "
..or what ever..."
Ein Kunde von mir wollte genau diese Textlinks mit Bilder + Lightbox haben. Also, Heikos RT eingebaut und gut ist...Denkste!
Kunde mault rum, viel zu kompliziert, will das nicht von Hand eingeben, muss immer die Bildnamen raussuchen etc.
Also hab ich mich mal rangesetzt und eine andere Lösung gestrickt und die sieht so aus:
HINWEIS VORAB:
Dieser Hack verändert Systemdateien (Core), daher bitte alte Dateien sichern falls Ihr nicht wisst was Ihr tut
Attention: This hack changes system files (core), so please save original files!
Das Konzept:
Concept:
Damit das ganze funktioniert muss folgende Datei angepasst werden:
The following file has to be customized to make it work:
Code: Select all
/include/inc_ext/fckeditor/editor/dialog/fck_link/fck_link.js
Ab Zeile 300 findet Ihr die Link Attribute:
from line 300 you find the advanced link attributes:
Code: Select all
// Get Advances Attributes
GetE('txtAttId').value = oLink.id ;
GetE('txtAttName').value = oLink.name ;
GetE('cmbAttLangDir').value = oLink.dir ;
GetE('txtAttLangCode').value = oLink.lang ;
GetE('txtAttAccessKey').value = oLink.accessKey ;
GetE('txtAttTabIndex').value = oLink.tabIndex <= 0 ? '' : oLink.tabIndex ;
GetE('txtAttTitle').value = oLink.title ;
GetE('txtAttContentType').value = oLink.type ;
GetE('txtAttCharSet').value = oLink.charset ;
Hier verändern wir den letzten Eintrag,
oLink.charset ersetzen mit
oLink.rel
change the last entry "oLink.charset" to "oLink.rel"
Code: Select all
GetE('txtAttCharSet').value = oLink.rel ;
Dann weiter unten ab Zeile 595:
beneath from line 595:
Code: Select all
// Advances Attributes
SetAttribute( oLink, 'name' , GetE('txtAttName').value ) ;
SetAttribute( oLink, 'dir' , GetE('cmbAttLangDir').value ) ;
SetAttribute( oLink, 'lang' , GetE('txtAttLangCode').value ) ;
SetAttribute( oLink, 'accesskey', GetE('txtAttAccessKey').value ) ;
SetAttribute( oLink, 'tabindex' , ( GetE('txtAttTabIndex').value > 0 ? GetE('txtAttTabIndex').value : null ) ) ;
SetAttribute( oLink, 'title' , GetE('txtAttTitle').value ) ;
SetAttribute( oLink, 'type' , GetE('txtAttContentType').value ) ;
SetAttribute( oLink, 'charset' , GetE('txtAttCharSet').value ) ;
Hier 'charset' ebenfalls durch 'rel' ersetzen.
also change "charset" to "rel"
Code: Select all
SetAttribute( oLink, 'rel' , GetE('txtAttCharSet').value ) ;
Ich habe "charset" gewählt, da das m.e. eh nie verwendet wird, zumindest habe ich das noch nie verwendet.
i select "charset" because i think this attribute isn´t used normaly
Es kann sein, dass ihr den browser cache löschen müsst damit die geänderte Datei neu geladen wird!
maybe you need to clear the browser cache so that the changed file will be reloaded by the browser!
Im FCK-Editor den Text markieren und auf Link klicken. Im folgenden Fenster ganz normal ein Bild als Ziel auswählen z.B. mittel Server durchsuchen:
Mark you text in FCK-Editor and klick the link-button. Choose a picture in the following window that you wish to display e.g. browse server...
In den Erweiterten Eigenschaften folgendes für die Lightbox eintragen:
In advanced link properties type in the following:
Die Bildunterschrift kommt in das Feld "Titel Beschriftung" und die Angabe das Lightbox verwendet werden soll kommt in das Feld "Ziel-Zeichensatz"
Put the image signature in the field "title caption" and the statement to use the lightbox in the fied "target charset"
Damit die Lightbox dann auch eingebunden wird habe ich mir freundlicherweise Heikos Code kopiert:
in order that the lightbox is embedded in the code i borrowed Heikos script:
Code: Select all
//Prüfung ob slimbox.css usw. schon vorhanden
if (!isset ($GLOBALS['block']['custom_htmlhead']['lightbox.css']))
{
$GLOBALS['block']['custom_htmlhead']['lightbox.css'] = ' <link rel="stylesheet" href="'.TEMPLATE_PATH.'slimbox/css/slimbox.css" type="text/css" media="screen" />';
}
if (!isset ($GLOBALS['block']['custom_htmlhead']['mootools.js']))
{
$GLOBALS['block']['custom_htmlhead']['mootools.js'] = ' <script src="'.TEMPLATE_PATH.'inc_js/mootools/mootools.js" type="text/javascript"></script>';
}
if (!isset ($GLOBALS['block']['custom_htmlhead']['slimbox.js']))
{
$GLOBALS['block']['custom_htmlhead']['slimbox.js'] = ' <script src="'.TEMPLATE_PATH.'slimbox/js/slimbox.js" type="text/javascript"></script>';
}
Den packen wir in einen html CP. Das sieht dann in etwa so aus:
put this script in a html CP, your content could look like this:
1. CP html -> obiges Script [PHP]...Prüfung ob Lightbox vorhanden...[/PHP]
2. CP WYSISWG Text eingeben und dann mit den obigen parametern verlinken
1. CP html -> above script [PHP]...check for lightbox...[/PHP]
2. CP WYSISWG type your text and use the link button with the above parameters
Fertig!
Thats it!
Das funktioniert logischerweise auch mit Bildern, allerdings ist die Handhabung etwas anders als gewohnt:
you can use this methode also for pictures, but the handling is a little bit different:
Im Editor das Bild einfügen, den Link auf das Lightbox-Bild aber
NICHT bei den Bild-Eigenschaften eingeben!
Jetzt das Bild markieren und den Link-Button aus dem Editor verwenden und dort wie beim Textlink verfahren.
Insert a picture that should open with lightbox effekt in your content e.g. WYSIWYG, but don´t use the link shown in the picture properties!
No mark your image and klick the link-button of the editor and input the text like you did for a textlink.
Getestet habe ich das ganze unter 1.3.5 also mit dem aktuellen FCKEditor. Hoffe ich hab es verständlich rübergebracht.
Testet with 1.3.5 actual FCKEditor. Hope all is understandable.
Please excuse my bad english!