Thanks for reply.
If i've read enough the doc, the only way to visually make a internal link by browsing your existing content is to select the "insert:edit cmsms link", right?
If you click the right button "insert:edit link" (the standard fck lin function), you cannot browse your content and select the page you want to link, right?
But :
the cMsms link only work if you select some text, otherwise you get an :
Code: Select all
alert( 'Please select a text in order to create a (internal) link' );
but if you overpass this alert it's possible to make a link on a img if you don't check the "generate taglink", otherwhise it inserts a single {selflink tag} and remove your ...
...if you don't check the "generate taglink" it makes the using a url with index.php?page=35, this url is not using a rewrite sheme, the correct href would be href="site.com/first_level/subpage" instead of href="site.com/index.php?page=35"
i've tested modifying some files in fceditor rep :
in fck_cmscontent.php :
Code: Select all
// line 125 : after : i' take the alias name of page as select value
echo "<option value=\"".$one->Alias()."\">".$one->Hierarchy()." ".$one->Name()." A:".$one->Alias()."</option>";
// before
//echo "<option value=\"".$one->Id()."\">".$one->Hierarchy()." ".$one->Name()."</option>";
Code: Select all
// line 67
//if (oTagLink.checked) {
//Create special CMS tag
// var sSelected;
// if ( oEditor.FCKBrowserInfo.IsGecko ) {
// sSelected = FCK.EditorWindow.getSelection();
// } else {
// sSelected = FCK.EditorDocument.selection.createRange().text;
// }
// var sPageId = oPageList[oPageList.selectedIndex].value;
// var sTagOutput = "";
// sTagOutput += "{cms_selflink page='" + sPageId + "'";
// sTagOutput += " text='" + sSelected + "'";
// if (txtTitle != "") {
// sTagOutput += " title='" + txtTitle + "'";
// }
//sTagOutput += " text='" + txtTitle + "'";
// sTagOutput += "}";
// oEditor.FCK.InsertHtml( sTagOutput );
//} else {
var sURL = document.getElementById( 'PageURL' ) ;
var sPageId = oPageList[oPageList.selectedIndex].value;
oLink = oEditor.FCK.CreateLink( sPageId ) ;
//oLink = oEditor.FCK.CreateLink( sURL.value + sPageId ) ;
SetAttribute( oLink, 'title' , txtTitle ) ;
//SetAttribute( oLink, 'alt' , txtAlt ) ;
//}
so if text or image are selected, i can click the cmsms link button, select my content page and it makes a classic using the page alias for href value.
i'm not experienced developper in JS/phP but it works fine for me with rewrite mod, for text and img tag...
...and you don't have to manually insert a {selflink} with option href to do the same thing...
voilà!