'selflink' tags replacing my images in 0.13

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
scotch33
Dev Team Member
Dev Team Member
Posts: 284
Joined: Tue Feb 14, 2006 9:56 pm

'selflink' tags replacing my images in 0.13

Post by scotch33 »

When I attempt to create an internal link on an image in Canary the image is replaced by (example) {cms_selflink page='14' text=''}.  It only happens on internal links - normal links are fine.  Also text is fine.  Is there a way around this other than surfing to the internal page in a browser and using the full address as an external link?

Thanks
John
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: 'selflink' tags replacing my images in 0.13

Post by Dr.CSS »

when you make the link in the page conent edit box by cliking the little self link button the popup window has an option check box...
Generate Taglink?  if you uncheck this it should work for you the way you expect...
ludo2k
Forum Members
Forum Members
Posts: 10
Joined: Sat Aug 12, 2006 10:43 pm

Re: 'selflink' tags replacing my images in 0.13

Post by ludo2k »

Hi,

Same problem here, unchecking the generate tag doesn't solve completely the problem :

I'm using rewrite url for my site (under 0.13), with fckeditor as default editor.

Original code with that image i wanted to have a internal link on :

Code: Select all

<p><img height="180" width="250" alt="" src="uploads/images/herisson.jpg" /></p>
If generate taglink is checked I obtain this code in source :

Code: Select all

<a href="index.php?page=31"><img height="180" width="250" alt="" src="uploads/images/herisson.jpg" /></a></p>
if not checked this code :

Code: Select all

<p>{cms_selflink page='31' text='undefined'}</p>
note that the tag have complety disapeared.

Output for code 1 :

correct image with link : index.php?page=31 <= where is my rewriting url?

Output for code 2 :
no image, just "undefined" with link to : /my_product/my_page_name <= correct url rewrite but no img tag!

This is the real problem...

Any solution?
Last edited by ludo2k on Mon Aug 14, 2006 2:59 pm, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: 'selflink' tags replacing my images in 0.13

Post by Dr.CSS »

Do you have the {metadata} tag in the head?
ludo2k
Forum Members
Forum Members
Posts: 10
Joined: Sat Aug 12, 2006 10:43 pm

Re: 'selflink' tags replacing my images in 0.13

Post by ludo2k »

Yes baseref is ok, but i think the first problem is that inserting a taglink on a picture remove the img tag... no?
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: 'selflink' tags replacing my images in 0.13

Post by Dr.CSS »

If you are trying to make the image a link to itself or aomething else there is a link option, second tab, that will let you use the image as a link.
ludo2k
Forum Members
Forum Members
Posts: 10
Joined: Sat Aug 12, 2006 10:43 pm

Re: 'selflink' tags replacing my images in 0.13

Post by ludo2k »

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à!
Post Reply

Return to “CMSMS Core”