Link to Internal Article from within Editor

Locked
User avatar
cosmicfantasia
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 146
Joined: Sun Sep 18, 2005 2:18 am
Contact:

Link to Internal Article from within Editor

Post by cosmicfantasia » Thu Jan 17, 2008 1:23 am

Joomla really really needs to have the option of linking to an article without having to first find out what the url is and then manually linking to that url. There should be a list of the articles and perhaps a context search to help find the articles..

:)
Total Web Presence for Good People doing Good Things > cosmicfantasia.net.au
Alternative New and Views for the Progressive Community > cosmicfantasia.com

If you truly love Nature, you will find beauty everywhere - Vincent Van Gogh

bodica
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Sun Nov 11, 2007 8:21 am

Re: Link to Internal Article from within Editor

Post by bodica » Thu Jan 17, 2008 12:14 pm

I second this request.

It's a time consuming trying to figure out what the URL is, especially when it's an article which isn't linked to a menu item already... etc.

(If anyone knows how to do this easily, please post it somewhere.)

User avatar
cosmicfantasia
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 146
Joined: Sun Sep 18, 2005 2:18 am
Contact:

Re: Link to Internal Article from within Editor

Post by cosmicfantasia » Thu Jan 17, 2008 11:50 pm

The xhtml suite editor does it but isn't for 1.5 yet. Should be core anyway.

Have heard devs talk about it before for a 1.6 release, but saw this forum and thought to post anyway. Can't hurt.
Total Web Presence for Good People doing Good Things > cosmicfantasia.net.au
Alternative New and Views for the Progressive Community > cosmicfantasia.com

If you truly love Nature, you will find beauty everywhere - Vincent Van Gogh

User avatar
Vince
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 143
Joined: Sun Aug 21, 2005 11:41 pm
Location: UK
Contact:

Re: Link to Internal Article from within Editor

Post by Vince » Thu Jan 24, 2008 10:30 pm

The core 1.5 already does this now for linking internal articles to a menu.
But I nelieve to do the same witin a page using the editor requires functionality to be built into the editor itself, so not really down to core devs, unless they maintain TinyMCE or another as the default Joomla editor?

It could really do with it for sure.

- Vince
www.hostbaron.com - low price Joomla starter packages.

www.SpanishVilla.com - Buy, rent or sell a Spanish property.

mtlnews

Re: Link to Internal Article from within Editor

Post by mtlnews » Mon Jan 28, 2008 4:01 am

I had the same problem but couldn't find a simple solution to it. So I built a Joomla! extension myself. I don't know if its listed in the extensions area yet, but you can check it out at codes.mtlnews.com.

If you find any bugs or problems, ill be glad to look into it.

Frank

User avatar
chopstik
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Fri Nov 09, 2007 3:04 am
Location: New Zealand
Contact:

Re: Link to Internal Article from within Editor

Post by chopstik » Tue Jan 29, 2008 5:33 am

Hi mtlnews,

Will be a great plugin. I did a fresh install onto Jv1.5 and got the following error when clicking on the "Link Article" button below the content editor.  I logged out and back into Administrator.  Any ideas?
Fatal error: Class 'JModel' not found in /home/kakapo/public_html/administrator/components/com_linkr/models/articles.php on line 11

User avatar
Vince
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 143
Joined: Sun Aug 21, 2005 11:41 pm
Location: UK
Contact:

Re: Link to Internal Article from within Editor

Post by Vince » Tue Jan 29, 2008 9:15 am

mtlnews wrote: I had the same problem but couldn't find a simple solution to it. So I built a Joomla! extension myself. I don't know if its listed in the extensions area yet, but you can check it out at codes.mtlnews.com.
If you find any bugs or problems, ill be glad to look into it.
Frank
Hi Frank,
This looks great. I especially like the preview part when selecting the article:
http://codes.mtlnews.com/images/stories/ss/linkr/4.png

I will definately give this a whirl soon.

- Vince
www.hostbaron.com - low price Joomla starter packages.

www.SpanishVilla.com - Buy, rent or sell a Spanish property.

ralig
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Mon Jan 28, 2008 5:58 pm

Re: Link to Internal Article from within Editor

Post by ralig » Tue Jan 29, 2008 5:57 pm

mtlnews wrote: I had the same problem but couldn't find a simple solution to it. So I built a Joomla! extension myself. I don't know if its listed in the extensions area yet, but you can check it out at codes.mtlnews.com.

If you find any bugs or problems, ill be glad to look into it.

Frank
Frank,
This extension works great!  The only problem I've had with it, is it replaces the highlighted text/items instead of making them be the link.  So I hacked at it a bit and changed the way it inserts the link.  If you leave the text field blank, it will put the a tags around the highlighted text.  Quick and Dirty hack, but it works well enough for me, and maybe will give you a good starting point for making this be implemented well.

In the file:  administrator/components/com_linkr/assessts/helper.js , I changed the link function:

Code: Select all

link:function(){
		t=$('linkText');
		u=$('linkURL');
		x=$('target');
		/*changed by ralig */
		if(t.value.length==0){
			var inst = window.parent.tinyMCE.selectedInstance;
			t.value = inst.selection.getSelectedHTML();
		} /*end changed */
		if(t.value.length==0){
			alert(this.missingText);
			t.focus();

User avatar
chopstik
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Fri Nov 09, 2007 3:04 am
Location: New Zealand
Contact:

Re: Link to Internal Article from within Editor

Post by chopstik » Wed Jan 30, 2008 12:31 am

Hi the mtlnews,

Last error resolved itself. However another crops up when you select an individual article:
Fatal error: Class 'JSite' not found in /home/kakapo/public_html/components/com_content/helpers/route.php on line 99
Any ideas?

// ALL SOLVED. WAS USING 1.5RC3, 1.5 STABLE FIXED ALL PROBS.  NICE WORK, GREAT PLUG IN.
You do not have the required permissions to view the files attached to this post.
Last edited by chopstik on Wed Jan 30, 2008 1:20 am, edited 1 time in total.

mtlnews

Re: Link to Internal Article from within Editor

Post by mtlnews » Wed Jan 30, 2008 3:06 am

The only problem I've had with it, is it replaces the highlighted text/items instead of making them be the link.  So I hacked at it a bit and changed the way it inserts the link.  If you leave the text field blank, it will put the a tags around the highlighted text.  Quick and Dirty hack, but it works well enough for me, and maybe will give you a good starting point for making this be implemented well.
Thanks ralig!

ralig
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Mon Jan 28, 2008 5:58 pm

Re: Link to Internal Article from within Editor

Post by ralig » Sat Feb 02, 2008 10:04 pm

OK, 1 problem with the code I gave for putting in the highlighted code:  It only works if you have TinyMCE set as your editor (which isn't so bad, since it is the default editor.)  If there is a different editor, it makes execution freeze, even in the 1.1.1 update.

I can't seem to find a solution to this.  There doesn't seem to be any other joomla editor function wrappers except for jInsertEditorText.  It would be nice if there were a jGetEditorSelected, or something of the sort.

mtlnews

Re: Link to Internal Article from within Editor

Post by mtlnews » Mon Feb 04, 2008 7:25 am

Your right, there isn't a "jGetEditorSelected". so I made a few changes to the code, and the highlighted code can only be used when editing with tinyMCE. The fact is that xstandard doesn't have a similar function already integrated.

That seems like the last bug. Do you know of any other popular editors I should consider considering?

Heres the new code:

Code: Select all

getSelectedText: function()
{
	if (window.parent.tinyMCE) {
		// Thanks to ralig
		var inst=window.parent.tinyMCE.selectedInstance;
		txt=inst.selection.getSelectedHTML();
	} else if ($('xstandard')!=false) {
		txt='';	// There is no way of finding the highlighted text in current version
	} else {
		txt='';
	}
	return txt;
}
To get the "xstandard" editor, we need to use getElementById(), or mootools' $().
I don't know much javascript, but that seems about right. Works for me anyways.

tell me what you think

ralig
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Mon Jan 28, 2008 5:58 pm

Re: Link to Internal Article from within Editor

Post by ralig » Mon Feb 04, 2008 2:01 pm

The new code looks great!  That should do the trick nicely.
That seems like the last bug. Do you know of any other popular editors I should consider considering?
By looking in the Joomla extension gallery, I found JCE and JoomlaFCK as two popular editors.  I know JoomlaFCK is updated for 1.5, but JCE doesn't appear to be yet.  I haven't looke dthrough the code or documentation for JoomlaFCK yet, so not sure if it has a function to get the selected text.

mtlnews

Re: Link to Internal Article from within Editor

Post by mtlnews » Mon Feb 04, 2008 3:25 pm

ill look into joomlaFCK, then ill try to convert the extension to be joomla 1.0.x compatible.

thanks again.

pafb12903
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Sat Feb 09, 2008 8:21 pm

Re: Link to Internal Article from within Editor

Post by pafb12903 » Sat Feb 09, 2008 8:31 pm

Hi mtlnews,

I am having problems with Linkr.  I installed the component and the plugin on my Joomla! 1.5 site and no errors were reported.  I am running my site in legacy mode for compatibility with docman.  When I attempt to link to another article from within an article there linkr button is missing.  Is there a step or something that I am missing?

Thanks,

Jim


Locked

Return to “Wishlists and Feature Requests - Archive”