Page 1 of 1

Linking to content items

Posted: Mon Oct 01, 2007 4:10 pm
by iparker
Hi,

I'm sure this another of those questions that really easy when you know how but I'm really struggling with it.

I basically want to make text links to articles that I haven't got published in a menu.  how is this accomplished?  If I click the {link} option from the WYSIWYG menu it brings up to insert the URL but I'm not even 100% sure to establish what the URL link is to the article without first adding it to a menu.

Please can you put me out of my misery!! I've tried a lot before coming here to ask.

Kind Regards as always to one of the best open source communities

Ian Parker

Re: Linking to content items

Posted: Tue Oct 02, 2007 8:39 pm
by timwhit
If you are running 1.0.13 the easiest way is to install the JCE editor. It has a button which allows you to add a hyperlink to an existing article on your site.

If you are running 1.5 you are basically out of luck at this point.

Well, you could create a new menu item that is linked to the article, copy the URL, then paste the link into the article you want to link from. This really needs to be included in TinyMCE, who knows when JCE will release a new version compatible with 1.5.

Re: Linking to content items

Posted: Sun Nov 04, 2007 1:08 pm
by jacy
Came here to find if there was anything new on this as 1.5 nears prime time. Hope this functionality is added soon!

In the meantime, I've found the fastest way is to use the Search feature. Hopefully the page to which I want to link is returned as a result, if not I have other problems! I navigate to the desired page then copy and paste the portion of the URL that I need.

A couple of my articles have lists to other articles in the same section/category and once I got the first list item's URL down, I was able to add other link URLs quickly by capturing the article ID from the admin article manager window listing. But for onsie-twosie links I found the Search tool is the fastest.

HTH
~Jacy

Re: Linking to content items

Posted: Mon Nov 19, 2007 5:22 am
by capkix
You aren't out of luck at all with Joomla 1.5 - you just need to look up the article id.

Here is the format without SEF turned on:

http://>/index.php?option=com_content&view=article&id=>
http://mywebsite.com/index.php?option=c ... le&id=1234

With SEF on:

http://>/component/content/article/>
http://mywebsite.com/component/content/article/1234

With SEF on and  add suffix to URLs on:

http://>/component/content/article/>.html
http://mywebsite.com/component/content/ ... /1234.html

Hope that helps,  :pop


Nash

Re: Linking to content items

Posted: Thu Nov 22, 2007 6:12 pm
by shambeko
Has anyone got this to work, all I want to do is place a text link back to another article (which is not assigned to a menu)

I have SEF ON and URL suffixes ON....

Any ideas, I am running RC3...


Thanks


Ian

Re: Linking to content items

Posted: Thu Nov 22, 2007 11:43 pm
by capkix
Ian,

Have you tried this?

http:///component/content/article/.html

It should work.



Nash

Re: Linking to content items

Posted: Thu Nov 22, 2007 11:54 pm
by shambeko
Whey hey....Thanks Nash

Seems to have done the trick


Cheers


Ian

Re: Linking to content items

Posted: Fri Nov 23, 2007 10:50 am
by shambeko
Well, ignore my last post.....

Although that allows me to link between articles, it does not help with a SEF URL because I end up with this -

http://mysite.co.uk/component/content/article/3.html - where 3 is the Article ID....

I would love to hear other users experiences or comments

Thanks

Ian.

Re: Linking to content items

Posted: Fri Nov 23, 2007 3:24 pm
by capkix
Ian,

From your last post I understand that http://mysite.co.uk/component/content/article/3.html isn't working for you.  This is odd because it is working fine for me with Joomla 1.5RC3 and SVN.

Can you try to do a search for your article and see what URL comes up?  If the URL that comes up in the search works, please post its format here so we can see.


Nash

Re: Linking to content items

Posted: Fri Nov 23, 2007 3:31 pm
by shambeko
Nash

Yeah it works, but I loose my ability to have a SEF URL...

On menu linked articles, I get a URL like http://www.mysite.co.uk/services/content_mangement.html whereas, why I link the text to another article I get http://www.mysite.co.uk/services/3.html  - can you see why I am not happy with this...

There must be an answer to this....

Ian.

Re: Linking to content items

Posted: Fri Nov 23, 2007 3:44 pm
by capkix
EEeeep.  That is unfortunate...

Perhaps someone with a bit better understanding of this could post a better explanation that preserves the J!1.5 feature of consistent SEF urls.

Re: Linking to content items

Posted: Fri Nov 23, 2007 4:00 pm
by shambeko
Let's hope so Nash, text links from article to article seem to be a basic requirement...

I hope there is someone who can join this thread and shed some light on it !


Ian.

Re: Linking to content items

Posted: Fri Nov 23, 2007 11:50 pm
by MaxRathbone
Thank you capkix! I knew with SEF & mod_rewrite there are more than one way to link to an article..I just needed one that is at least SEF... THANK YOU. Been waiting for a response on my thread, but at least this gets me headed in the right direction again!!

Amazing that such a simple thing as finding out the URL is so difficult and requires 'special' knowledge(out of the WYSIWYG) to know.
capkix wrote: You aren't out of luck at all with Joomla 1.5 - you just need to look up the article id.

Here is the format without SEF turned on:

http://>/index.php?option=com_content&view=article&id=>
http://mywebsite.com/index.php?option=c ... le&id=1234

With SEF on:

http://>/component/content/article/>
http://mywebsite.com/component/content/article/1234

With SEF on and  add suffix to URLs on:

http://>/component/content/article/>.html
http://mywebsite.com/component/content/ ... /1234.html

Hope that helps,  :pop


Nash

Re: Linking to content items

Posted: Fri Nov 30, 2007 7:45 am
by yvolk
shambeko wrote: Yeah it works, but I loose my ability to have a SEF URL...

On menu linked articles, I get a URL like http://www.mysite.co.uk/services/content_mangement.html whereas, why I link the text to another article I get http://www.mysite.co.uk/services/3.html  - can you see why I am not happy with this...

There must be an answer to this....
Very interesting and really important feature: linking to content items. First time I faced this problem 7 years ago, developing my own specialized (distance learning) web application, that had content publishing features (so in fact, it was CMS  :) )...

I came to the conclusion, that this links between Articles ('content items'...) should be dynamic!
So, I think, that best and universal approach is something like 'special type of BBCodes' inserted into Articles and converted to Hyperlinks on the fly.
There may be three variants, referring to Articles by:
1. id, e.g. [contentid=3]Content management[/contentid]
2. alias, e.g. [contentalias=content_mangement]Content management[/contentalias]
(I copied your alias, that is mistyped  ;))
3. article title, e.g. [contenttitle]Content management[/contenttitle].

Joomla has built-in ability to construct URLs to Articles, according to the current site settings: so dynamically created links would be just the same, as links, created (also dynamically) for e.g. "Latest news" (from modules\mod_latestnews\helper.php file):

Code: Select all

$lists[$i]->link = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catslug, $row->sectionid));
And the last point: There is already such BBCode plugin, that may be extended to process this Joomla!-specific BBCodes: yvBBCode.

What, pals, do you think about this? Maybe some corrections/additions to my proposal?

Re: Linking to content items

Posted: Fri Nov 30, 2007 4:44 pm
by MaxRathbone
I, for one, would love to see this kind of dynamic linking inside Joomla:
[contentid=3]Content management[/contentid]

Re: Linking to content items

Posted: Sat Dec 01, 2007 1:44 pm
by annunaki
or just the same way as it's currently done in to link a menu item to a content item? That's a very elegant solution, and you won't have to look up the contentid

Re: Linking to content items

Posted: Sat Dec 01, 2007 5:03 pm
by yvolk
annunaki wrote: or just the same way as it's currently done in to link a menu item to a content item? That's a very elegant solution, and you won't have to look up the contentid
This means, that you proposes linking to the "Menu item"!
E.g. [itemid=3]Title for the link to the Menu Item[/itemid]

Re: Linking to content items

Posted: Sat Dec 01, 2007 6:24 pm
by annunaki
No, I mean linking to the content item; I just like the way that happens when you link a menu item to a content item; i.e. the javascript-lightbox

Re: Linking to content items - implemented in yvBBCodes

Posted: Sun Dec 02, 2007 9:40 am
by yvolk
yvBBcode extension was extended to support links between Articles.
Currently yvBBCode supports one BBCode for this purpose: contentid.
E.g. [contentid=3]Content management[/contentid] is replaced by the link to the Article with id=3.

I tried to create links exactly like Joomla! itself does it  :), though it appeared, that there was no function e.g "ContentIDToURL" ready to use...

Do you like this implementation of "Linking to content items"?

For general discussion about this extension (and bug reports...) please see this topic: yvBBCode - BBCodes extension for Joomla! 1.5.