Is there a way to make a link to another node? I would need a link to a view, and I haven't found a way besides writing the complete url as a link, which I think isn't a good way of doing so...

thanks

Comments

ontwerpwerk’s picture

at the moment there is no other way to make links from within FCKeditor... CCK has ways to reference nodes, but not views etc. and that will not work in a textarea either

I don't know of a good way to do it either, so I'm open to suggestions, maybe a combination of drupal filters and a FCKeditor plugin

enboig’s picture

I think fckeditor+filter is a good way; maybe something like:

fckeditor:
popup with a list of nodes, sorteable, etc....

filter:
[text:"link to article",node:20]

zostay’s picture

You can do the fckeditor with a filter solution already. I've done it with interwiki, but there are several others to choose from.

However, I would like to see something like nodereference incorporated into the link popup. We're currently migrating away from a CMS called Magnolia that uses FCKeditor. One of Magnolia's nifty features is that they provide a nice browser for linking to other pages within the FCK link dialog.

My vision would be that the drop-down containing http:// could contain a couple new options:

  • node would offer an autocomplete box to lookup nodes like the nodereference does.
  • local URL (not a great name but...) would provide just a text box for you to enter whatever link you want without the full URL, such as "admin/settings". It could be anything.

Then, fckeditor could be combined with a filter (possibly one already exists that could do this) that would convert those links into Drupal URLs using the url() function.

ray007’s picture

Maybe integration with Easylink is what we would like?
I have already written in issue over there some time ago, and the maintainer seems amenable: http://drupal.org/node/146998

ontwerpwerk’s picture

Status: Active » Closed (won't fix)

at the moment there is no plan to implement this in the module

glass.dimly’s picture

Status: Closed (won't fix) » Active

Hey all,

A "link to node" button would make transferring content from a non-Drupal site to a Drupal one a lot easier. I wanted to flag it active just because its still a good idea if anyone has time.

Also, because I think TinyMCE has too many bugs to use, it would be nice if FCKeditor had some of the handy-dandy Drupal integration stuff like Tiny, which would make it easier for newbies and would increase Drupal's appeal generally.

Thanks,
Jeremy

clauded’s picture

I did something similar for a personal cms project in asp. Here the code I used to generate a list of pages available in my cms. We could convert it to php and adjust the sql code for Drupal nodes :

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<meta name="robots" content="noindex, nofollow" />

<link rel="stylesheet" type="text/css" href="<%= CMS_PATH %>style/cms-style.css">

<script src="../../dialog/js/fck_dialog_common.js" type="text/javascript"></script>

<script type="text/javascript">

	var dialogArguments = window.parent.InnerDialogLoaded() ;

	var oEditor = window.parent.InnerDialogLoaded() ;

	var FCK	= oEditor.FCK ;

	var FCKLang	= oEditor.FCKLang ;

	var FCKConfig = oEditor.FCKConfig ;

	

	// Sets the Skin CSS

	document.write( '<link href="' + dialogArguments.FCKConfig.SkinPath + 'fck_dialog.css" type="text/css" rel="stylesheet">' ) ;

	

	function insertChar(td)

	{

		mySelection = FCK.EditorWindow.getSelection() ;

		oEditor.FCK.InsertHtml( td.innerHTML.replace('[ - ]', mySelection) ) ;

		window.parent.Cancel() ;

	}

	

	function over(td)

	{

		td.className = 'LightBackground HandIE HandMozilla' ;

	}

	

	function out(td)

	{

		td.className = 'DarkBackground HandIE HandMozilla' ;

	}

	

	function setDefaults()

	{

		// First of all, translate the dialog box texts

		dialogArguments.FCKLanguageManager.TranslatePage(document) ;

		// Activate the "OK" button.

		// window.parent.SetOkButton( true ) ;

		

		// Set the dialog tabs.

		window.parent.AddTab( 'Tab1', oEditor.FCKLang.DlgDbLinksTab1 ) ;

		//window.parent.AddTab( 'Tab2', oEditor.FCKLang.DlgDbLinksTab2 ) ;

	}

		

	// Function called when a dialog tag is selected.

	function OnDialogTabChange( tabCode )

	{

		ShowE('Tab1', ( tabCode == 'Tab1' ) ) ;

		//ShowE('Tab2', ( tabCode == 'Tab2' ) ) ;

	}

</script>

</head>



<body onload="setDefaults()" scroll="yes">

<div id="Tab1">

	<table width="590">

		<tr><td>&nbsp;</td><td><b>Section</b></td><td><b>Page</b></td></tr>

		<%

		sql = "select * from pageSection order by PageSectionCatId ASC, PageSectionOrder ASC"

		set rsps = conn.execute(sql)

		if not rsps.eof then

			n = 0

			do while not rsps.eof

				sql = "select * from pageDetail where PageSectionID = " & rsps("pagesectionid") & " and pageVisible <> 0 order by pageOrder"

				set rs = conn.execute(sql)

				if not rs.eof then

					do while not rs.eof

						data = "<tr"

						if n mod 2 = 0 then

							data = data & " class='lightrow'"

						else

							data = data & " class='darkrow'"

						end if

						data = data & ">"

						data = data & "<td onclick='insertChar(this)'>"

						data = data & "<a href='" & CMS_PATH & "page.asp?pageid=" & rs("pageID") & "'>" & "[ - ]</a></td>"

						data = data & "<td>" & server.htmlencode(replace(rsps("pageSectionName"), "&#39;", "'")) & "</td>"

						data = data & "<td>" & server.htmlencode(replace(rs("pageTitle"), "&#39;", "'")) & "</td>"

						data = data & "</tr>"

						response.write(data)

						n = n + 1

						rs.movenext

					loop

				end if

				rsps.movenext

			loop

		end if

		%>


	</table>

</div>





</body>



</html>



wwalc’s picture

Actually it is already possible to use linktocontent and linktonode features, use the 5.x-2.x-dev version of FCKeditor module and follow the instructions from README.txt.

open-keywords’s picture

Title: link to node » link to node does the job

great input, thanks !

RWWood’s picture

I finally got it to work after figuring out that I also had to enable the two linktonode plugins. DUH

adpo’s picture

re: #10
linktocontent with FCeditor sounds fine, but not for Drupal 6. Any Drupal 6 solution?

wwalc’s picture

Status: Active » Fixed

Marking this issue as fixed for 5.x.

Let's track Drupal 6 integration here: #331329: LinkToContent integration progress. I suppose it will be available relatively soon.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.