drupal internal links

tryrmdashrf - May 4, 2006 - 12:42

Is there a way to create internal links? For example, in typo3 you could insert:

<LINK 453>My Link to page id 453</LINK>

Thanks,

Alan

It's not as abstact, but quite simple nonetheless...

drubeedoo - May 4, 2006 - 16:59

Use the following standard html in Drupal:

<a href="/node/453">My Link to page id 453</a>

If you have CleanURLs turned on, and your subject is: "My Link to page id 453," then you'll use something like:

<a href="/my-link-to-page-id-453">My Link to page id 453</a>

(Check your URL with CleanURLs turned on to see what the href URL should be to your page.)

If the above is too challenging to your users...

If you have html illiterates writing content on your site, you can download and enable the BBCode module, or load TinyMCE or FCKeditor.

the above is definitely too challenging...

tryrmdashrf - May 4, 2006 - 17:04

Yeah,

I was afraid of that, they had a hard time with the <LINK #ID> thing. I will try out the editors. Thanks for the list!

Alan

l(linktext, path)

Nick Urban - July 8, 2006 - 09:04

I realize you're looking for templating for end users, but what I was looking for when I found this page was the l function.

Hopefully this will help somebody out.

Internal links and aliases - pathauto and pathfilter

mike_c - March 5, 2008 - 00:42

Hi,

I started using Drupal about a month ago, and have been busy migrating a website (www.duofertility.com) onto the system. I found this post because I was looking for a way to make internal links in Drupal. Because it's taken me several days to achieve what I wanted, I figured I'll post a comment here in the hope that it will save someone else some time.

I'm using Drupal 5.7, clean URLs and the pathauto module to create aliases based on page titles. I wanted to be able to link to internal pages, but I needed the links not to break when users changed page titles, thus changing pathauto URLs.

One way of doing this was to simply use the node numbers in links, but as far as I understand, that's not too good for SEO. It's better to have links that use URLs visible to search engines in the sitemap - i.e. the aliases. So, the way to do that was create links using aliased paths - but then when the titles change, the URLs change, and the links would break.

One solution I found was the path_redirect module, which would automatically create HTTP redirect pages on old aliases to the new aliases (integrated into pathauto). The disadvantage of this approach is that several changes to an alias would create a chain or redirects (unless I'm misunderstanding how redirects work?). Plus it seems messy to just create lots of redirects when the page titles change (even if it's just one letter!). It is useful for keeping pages with established page ranks live though - so I'll use it later on.

The best solution was to use the pathfilter module, which allows links to be written in the following format: "internal:home/something.html". Here is an extract from the readme file which was very useful:

Path Filter takes internal drupal paths in double quotes, written as
e.g. "internal:node/99", and replaces them with the appropriate absolute
or relative URL using drupal's url() function [1].

Suppose your site is located at 'http://example.com/mysite', clean URLs
are enabled, and 'node/99' has a URL alias of 'news/latest'. The following
are some examples of the replacements performed by this filter.

"internal:admin/user" -> "http://example.com/mysite/admin/user"
"internal:node/23" -> "http://example.com/mysite/node/23"
"internal:node/99" -> "http://example.com/mysite/news/latest"

So, I could now write links based on their node numbers, so that they wouldn't break if the aliases were changed (or deleted) - whilst at the same time retaining the alias URLs for SEO.

I hope this helps someone who is looking to solve the same problem - and please, if I've made some sort of stupid mistake or misunderstood something, I'd welcome any comments.

Cheers,

Mike

thanks !

hapydoyzer - July 4, 2008 - 04:23

thanks !

And the link to this module that helps you make internal links

Benjamin Melançon - August 16, 2008 - 11:32

Is http://drupal.org/project/pathfilter

This project definitely looks to be around for the long haul, which is important for the future of your site! You could create custom snippets for a module like http://drupal.org/project/bueditor to put the "internal:" wrapping in automatically.

benjamin, Agaric Design Collective

Internal linking by selecting from a popup list of nodes

ethanre - March 15, 2008 - 18:45

I started a new thread for Internal linking using wysiwyg http://drupal.org/node/234630

If using TinyMCE, (its

onetreehill - May 28, 2008 - 05:50

If using TinyMCE, (its almost worth switching if not), here's the solution:
http://drupal.org/project/linktocontent

This TinyMCE solution is only

hilikusOnline - June 19, 2009 - 08:42

This TinyMCE solution is only for Drupal 5, not support for 6.x yet :(

 
 

Drupal is a registered trademark of Dries Buytaert.