Home

Primary links

  • top o the deck
  • Drupal for Beginners
  • about
  • links
  • give me some sugar

Drupal stuff

  • EDAM
  • STARDOM
  • Question Bank
  • Drupal musings
  • Drupal tips
Home Easy Drupal Admin Manual (EDAM) Organizing Your Content Menus, Links, and Paths: Navigating the Site

Key stuff on this site

Easy Drupal Admin Manual (EDAM)

SEO, Traffic and Revenue: Drupalace's Online Manual (STARDOM)

Drupal for Beginners

Subscribe to posts by RSS or email

Subscribe to Drupal Ace by RSS feed RSS feed 

Subscribe to Drupal Ace by Email

Donate towards my web hosting bill! Get a great host!

Share and save

Share/Save

Random piece of content

Tip for friendlier content creation

Manuals on this site

  • Easy Drupal Admin Manual (EDAM)
    • Welcome to Your Site
    • First Steps: Please Read!
      • Understanding These Instructions
      • Important Terminology!
      • Best Practices for Site Admins
    • Super Quick Guide (for the experienced and the brave)
    • Logging In
    • Your Administrator Tools
    • Setting Site Basics
      • Setting Site Information
      • Configuring Your Theme
    • Creating Content
      • Node Types
      • Create a Page Node
      • Create a Story Node
      • Create a Blog Entry Node
      • Making Images and Other Files Available
      • Using Text and Image Editors
    • Organizing Your Content
      • Terms, Vocabularies, and Taxonomy: "Tagging" Your Content
        • Taxonomy Suggestions
      • Menus, Links, and Paths: Navigating the Site
        • Content Paths and URLs
        • Creating Links
        • Working with Menus: Administration Form (Drupal 6)
        • Working with Menus: Administration Form (Drupal 5)
        • Creating Menu Items on the Fly
        • Placing Menus on Your Pages
      • Placing Content on pages
        • Creating a page from a Single Node
        • Creating a page from a List of Nodes
        • Setting the Front Page
      • Working with Blocks
    • Maintenance Stuff
      • Maintenance and Construction Notices
    • Other Fun Things
      • Changing Color of Garland Theme
      • Free Aliases!
  • SEO, Traffic and Revenue: Drupalace's Online Manual (STARDOM)
    • Set a Clear Goal
    • Make a Good Site
      • Put out the Welcome Mat
      • Make Great Content
      • Build a Great Brand
      • Make Navigation Easy
      • Tune Site Performance
    • Drive Traffic
      • Promote your Site
      • Get Found with SEO
    • Build a Community
      • Build an Offsite Community
    • Monitor and Improve
    • One-Page Checklist
    • Drupal and the Blogging Starter Checklist
      • Drupal and the Blogging Starter Checklist, Part 1
      • Drupal and the Blogging Starter Checklist, Part 2
      • Drupal and the Blogging Starter Checklist, Part 3
      • Drupal and the Blogging Starter Checklist, Part 4
      • Drupal and the Blogging Starter Checklist, Part 5
      • Drupal and the Blogging Starter Checklist, Part 6
      • Drupal and the Blogging Starter Checklist, Part 7

You said it!

  • Dive Shop Singapor...

     

    I’m still learning from you, as I’m trying to reach my goals. I...

  • Blog Entry

    As per Search Engine Optimization, a blog is better than a webpage,...

  • This is a fantasti...

    This is a fantastic website and I can not recommend you guys enough. Full of useful resource and...

  • What stage is your...

    I am totally buying this article! The humor contained in this can bring you aftershocks of...

  • Tough one to Inves...

    I have heard and read stories such as this one before, and their common denominator is Drupal...

more

Creating Links

  • admin
  • Drupal
  • links

Links are how visitors get from one page to another. You'll probably put a lot of links in menus – a menu being just a list of links to other content. But you may also place links directly inside content text, or inside a block's text.

You may want links that point to a specific content item on your site, or a specific page on an outside web site. Or you may want powerful links that pick up and return a list of multiple content items from your site's database.

There's a lot you can do. Here's a basic guide to linking:

Placing Links

Know the path

A link is a pointer to another page or node address. The first thing you need to know is the target page's address: its path (or if it's external, such as a page on another website, its URL). If you haven't done so, see Content Paths and URLs.

You're now armed with the paths you need for the links you'll create. Next:

Linking to a path or external URL

Putting a link into a menu item

Every menu item needs to specify a path; sending the visitor to that path is the purpose of a menu item. When creating or editing a menu item, you input the path into the 'Path' field. See Working with Menus: Administration Form.

For an internal path, you only need to input the path, not the entire URL starting with http://<www.yourdomain.com>. For example, if the link is to a product description page with the path products/home/superbroom, then products/home/superbroom is all you need to input.

For an external URL, input the whole URL, starting with http:// .

For an email address, write mailto:, followed by the address: mailto:info@google.com, for example. Clicking on that menu item's link will prompt the user's email program to draft a message. 

Putting a link into content text

If you want to place a link to an external URL or an email address into a block of text, you likely don't need to do anything special. If the text field uses a text editor like TinyMCE or FCKeditor, the text editor may be set up to automatically convert certain addresses into working links. Just type the URL or email address normally – like www.google.com or <www.yourdomain.com>/news/special-report – and the text editor should do its magic when you save the content. You probably don't even need the http:// part of those URLs (but test to make sure). Your site may perform the same nifty trick for email addresses too, turning email@google.com into a working email link.

Again, though, that'll only work in a field using such a text editor which has been set up to create those automatic links; yours might not be (in which case you'd need to configure Input Formats to improve things – a topic for later).

More importantly, you probably don't want to use a full URL for every link. You probably want to bury the link within other words (like "read my hosting revue" or "Visit the National Geographic site"). How to do that?

The easiest way is to use the 'insert/edit link' function in your text editor (see Using Text and Image Editors). You select the words you want to imbue with a link, click the appropriate 'insert/edit link' button, type the URL into the window that pops up, and close the window. Voilá, a link embedded in the text.  

However, a caution (for typical, if not necessarily all, Drupal setups): Unlike the above procedure for placing a link into a menu item, here you do need to consider the full URL, even for internal pages. If you only put in the part of the path that follows http://<www.yourdomain.com>/, Drupal will likely try to append that path to the current page path, which may not at all be what you want.

That'll make a lot more sense with a simple example.

My page called 'Drupal for Beginners' has the internal path drupal-for-beginners and the URL http://www.drupalace.com/drupal-for-beginners. Say I want to embed a link to it within the last four words of the following text: "Read my overview of Drupal for beginning users."

First, I'll call up my 'insert/edit link' function and input just the internal path:

Link using internal path only

Here's the link that results:

"Read my overview of Drupal for beginning users."

It's no good. My text editor took the path for this page (EDAM/creating-links) and tacked drupal-for-beginners onto the end of that, creating the monstrosity www.drupalace.com/EDAM/creating-links/drupal-for-beginners as the final URL. That'd be fine if it were what I wanted, but in this case, it's not. There's no page with that URL and thus the link is broken.

(Edit, many months later: Hmm, at first my text editor was creating the wrong URL shown above. I just checked again, and now it's instead creating www.drupalace.com/EDAM/drupal-for-beginners . I don't know what change I made to the site's configuration to spur that change... but either way, it's an invalid link! So read on.) 

This time, I'll insert the whole URL:

Link using whole URL

Here's the link that results:

"Read my overview of Drupal for beginning users."

That one works!

Keep that point in mind as you create links. You don't want broken links littering your site.

Link to a Term's path

Recall that a "Term" is a "keyword" that tags your content. You can link to a Term, which will return all nodes tagged with that Term. For example, you can make a menu item named 'See All Products' which links to the Term 'product', and when clicked returns all nodes tagged with the Term 'product'. An instant, simple product catalog!

What you want here is the Term's path. A Term has a path like any other content; once you now it, you can do use it like any other path. See Content Paths and URLs to find a Term's path.

Link to multiple Terms

Now comes the powerful stuff: combining multiple Terms in one link. You can create a link that returns all nodes that are tagged with the Terms 'product' and 'technology', for a narrow list of only nodes that deal with both of those topics. Or you can create a link that returns all nodes that are tagged with the Terms 'product' or 'technology', for a broader list of all nodes about either of those topics.

First, note the path for each Term you'll use. For the following examples, say you'll use three Terms whose paths are taxonomy/term/1, taxonomy/term/5, and taxonomy/term/13:

AND combinations: Write the path like this:

 taxonomy/term/1,5,13 

to return nodes tagged with all three of the Terms.

OR combinations: Write the path like this:

 taxonomy/term/1+5+13 

to return nodes tagged with any one of the Terms.

Use the same format, separating numbers with commas or plusses, whether you're combining two Terms or twenty. (Naturally, you'll replace the above "1", "5", and "13" with the appropriate numbers you've confirmed for your Terms.)

If you think the above sounds hard to remember, you aren't alone. It's definitely strange that OR combinations, not AND combinations, use the symbol "+" in their syntax. It sounds backward. Chalk it up to an odd quirk of Drupal, and move ahead.

Link to a Term and all its child Terms

Terms can be "hierarchical", with "child" Terms placed below a "parent" Term. (See Terms, Vocabularies, and Categories: "Tagging" Your Content.) One example: a Term 'machinery', with child Terms below it like 'pump', 'generator', etc.

If you'd like to create a link that picks up content tagged with the parent or any of its child – 'machinery' or 'pump' or 'generator' in the above example – there are three ways.

The first and simplest method in concept: Make sure that you tag all pump-related nodes with 'pump' and 'machinery'. That way, a link to the Term 'machinery' will pick up all pump-related nodes as well. But here's the catch with that method: If you forget to include the tag 'machinery' on your Model 501 Grease Pump product description node, the link will miss it.

The second method is as described above: Link to the combined terms, like taxonomy/term/1+5+13. This link will catch the Model 501 Grease Pump node, on which you included the 'pump' tag but forgot the 'machinery' tag. That's better, but there's another problem: As you add new child Terms, you need to keep updating the link to include the new Terms (so that it ends up looking like taxonomy/term/1+5+13+24+25+31+33 and on and on.)

The third way is as follows: Link to the 'machinery' Term only, and tack on /all at the end of it. It might look like this:

taxonomy/term/1/all

That link will pick up content tagged with Term 1 ('machinery' in this example), plus any child Terms below that, even any new ones you add later. Handy!

Share/Save
‹ Content Paths and URLs up Working with Menus: Administration Form (Drupal 6) ›
  • Printer-friendly version
  • Quote
Beach Cruisers's picture

 Loads of excellent writing

Submitted by Beach Cruisers (not verified) on Thu, 2011-10-13 15:13.

 Loads of excellent writing here. It was indeed very helpful and insightful while being straight forward and to the point. Thanks for the posting.

  • reply
  • quote
ohnode's picture

link to product info page

Submitted by ohnode (not verified) on Mon, 2011-08-15 04:48.

I have displayed a list of products on a page, and now want, when a client clicks on a product image, title, or description he will be taken to an individual product page. I want to use just one product page "template or shell" and have different products display in it. TY so much for helping this nerd node.

  • reply
  • quote
Cotton Yarn's picture

Cotton Yarn

Submitted by Cotton Yarn (not verified) on Thu, 2011-06-30 02:34.

This is a really good read for me. its really very good post. Thanks for posting this informative article.

  • reply
  • quote
simpson helmets's picture

simpson helmets

Submitted by simpson helmets (not verified) on Thu, 2011-06-30 02:05.

A great and very valuable information about this topic. Thank you very much for sharing.

  • reply
  • quote
ecommerce Newcastle upon Tyne's picture

ecommerce Newcastle upon Tyne

Submitted by ecommerce Newcastle upon Tyne (not verified) on Thu, 2011-06-30 01:38.

I wanted to thank you for this excellent read. its very fine post. thanks for sharing it.

  • reply
  • quote
Testking 70-642's picture

Testking 70-642

Submitted by Testking 70-642 (not verified) on Thu, 2011-06-16 20:40.

Its a very good post. I was very pleased to find this site. I wanted to thank you for this great read.

  • reply
  • quote
Unknown Drupaloid's picture

WOW your attendant came up

Submitted by Unknown Drupaloid (not verified) on Fri, 2011-06-03 21:18.

WOW your attendant came up primary in Google. And this is what I was hunt for.

  • reply
  • quote
Testking 000-106's picture

great work!

Submitted by Testking 000-106 (not verified) on Wed, 2011-06-01 16:01.

its good to be there you are the best bloger i ever seen you have ever done a great work i appreciate you for your great work, keeo it up....

  • reply
  • quote
Clinique Happy perfume's picture

I was not using taxonomy and

Submitted by Clinique Happy perfume (not verified) on Wed, 2011-05-04 17:58.

I was not using taxonomy and paths to do this. Your careful explanations made this possible for me to do this the right way. Thank you so much

  • reply
  • quote
flour mill's picture

day!

Submitted by flour mill (not verified) on Thu, 2011-04-21 17:57.

agree that much of what's "hard" in Drupal is actually easy, as long as clear explanations are at hand!thank you !

  • reply
  • quote
gout treatment's picture

tip

Submitted by gout treatment (not verified) on Wed, 2011-03-02 14:40.

It is a great tip that it will only work in a field using such a text editor which has been set up to create those automatic links.

  • reply
  • quote
fontana auto glass's picture

great data

Submitted by fontana auto glass (not verified) on Sat, 2011-01-22 12:52.

This is very much applicable to our current project. Thanks for savings us from lots of headaches.

  • reply
  • quote
Scott's picture

Thanks for the clear explanations!

Submitted by Scott (not verified) on Thu, 2011-01-13 01:11.

Hi,

I just overcame the beginner's problem of trying to post storys and other items to pages. I was not using taxonomy and paths to do this. Your careful explanations made this possible for me to do this the right way. Thank you so much! 

It's very easy and intuitive once you've gotten your mind around it, thanks again for the breakthrough.

Scott

  • reply
  • quote
Drupalace's picture

Explanations

Submitted by Drupalace on Sat, 2011-01-29 01:35.

Please accept my late thanks for the kind words. I agree that much of what's "hard" in Drupal is actually easy, as long as clear explanations are at hand!

  • reply
  • quote

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd><br><p>
  • You may quote other posts using [quote] tags.
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options


Relevant Content

The Drupal Ace logo has dealt these content suggestions from the deck.

  • Working with Menus: Administration Form (Drupal 6)
  • Menus, Links, and Paths: Navigating the Site
  • Working with Menus: Administration Form (Drupal 5)
  • Taxonomy Suggestions
  • Creating a page from a List of Nodes
  • Creating a page from a Single Node
  • New EDAM pages: Placing Content on Pages

Learn Drupal, hands-on

Get the beginner-friendly ebook that teaches community site building via a live case study.

Drupal 6 Ultimate Community Site Guide

Read the review

It's a deal!

Dreamhost dealsDrupal Ace presides over his domain, proudly ensconced in his DreamHost eyrie. Won't you join me?

Promo code deal!

Just enter the code 49ER when you register for an account, and save $49 off the already-low price. No strings!

Read my hosting service review

Drupal mini tip

An obvious but important tip: When installing a new module, be sure to check for READ ME files or other instructions! It's easy to forget that not all modules are simple "plug and play"; some require special preparation, such as modifications to the site's Theme, to work their magic.

Remember, modules often make changes to your ste's database, its very "DNA". Take their installation seriously: read modules' instructions, and back up the database before installation too. 

Powered by Drupal, an open source content management system

Copyright 2007 and forever after. Made with Drupal, of course. On OS X, of course. Served up by DreamHost. DreamHost

RoopleTheme