Links
A Link, or "redirect," is a content type that, when you view it, redirects you to a particular URL. They are generally used as an easy way to send the user to an off-site page.
What Links Can Do For You
Unlike most other content, Links are never viewed as a page on the
public site; a user going to http://www.oxfamamerica.org/some_link will be
redirected to the target URL you specify in the Edit Link
Screen. This is useful for a few different tasks:
- Link to off-site pages. Links can be used to make off-site links appear in the left-hand navigation or on any page that's generated automatically. Examples are the Links in the Donate section, which appear in the left-hand nav but point to GetActive pages, and the Links on the What Oxfam Is Saying page, which point to recent news stories on other sites.
- Create redirect shortcuts. It's often useful, especially when printing a URL in a publication, to have a short, legible, and memorable URL, such as http://www.oxfamamerica.org/coffee. We use Links in a special folder to create these redirects.
- Link to on-site pages. Occasionally, it's useful to have a page show up in the left-hand navigation that actually lives in another part of the site. You can achieve this effect by creating a Link that will show up in the navigation but send the user to a different section. This is a questionable practice, as it undermines the user's expectations about how the site is organized, but we do it occasionally anyway, if it seems to add real value for the user.
- Fixing "Not Found" errors. If you move or rename an old
page, and your site statistics show you that many users seem to be
looking for it and getting a Not Found error, you can often create a
Link to send people to the new page, or to a substitute page if the old
one has been removed. This will only work if the old page had a fairly
unique name, such as "art2354.html" (the format of our old site's
URLs).
Creating Links
In order to create a Link, this content type must be enabled in the folder you're adding to [XXX: link]. As with all other content, you can use the Add New Item button to add a new Link [XXX: link].
Links have very few elements: the basic Short Name, Title, and
Description, and a field called URL. Because the user never sees a link
on its own page, the Description can be ignored. The Title will show up
in the left-hand navigation, and can also come up in on-site searches,
so it should generally be something appropriate for the general
public.
The two most important elements of a Link are the Short Name and the
URL. The Short Name, as with all content, defines the URL where the
link object will be located. For example, the link at http://www.oxfamamerica.org/whatyoucando/donate/donate_online,
which redirects the user to our off-site donation page, has the Short
Name "donate_online". Setting the Short Name to something
human-readable and appropriate is especially important when using Links
as redirect shortcuts (see below).
The URL field on the Edit Link screen defines the URL the
user will be sent to when he clicks on the Link. In the case of the
donation Link, above, the URL field is set to https://secure.ga3.org/02/oxfamamerica, the URL of
our secure off-site donation page. Despite what the field description
says, your URL should be "fully qualified," i.e. it should start with
"http://" or a similar prefix, even if it's going to another page on
the Oxfam America site.
That's basically it - save the Link and publish, and it will
redirect any user who views it to the URL you select.
Redirect Shortcuts
As noted above, it's often useful to have short, snappy URLs for
pages that you want to publicize in print or elsewhere. These URLs are
generally in the formatĀ http://www.oxfamamerica.org/one_word_or_phrase.
Creating these redirects is easy. In the English Homepage workspace
there's a folder called Redirects. Inside there are a bunch of Link objects.
If you make a new Link there, and publish the workspace, it will work
like a redirect:
- Set the link Short Name to the id you want in the redirect URL -
e.g. if you want it to be located at oxfamamerica.org/one, use "one" as
the Short Name.
- Set the link target as the full URL of the page you want the
redirect to go to, e.g.
"http://www.oxfamamerica.org/whatwedo/campaigns/one_campaign".
- Save, publish, and try it out.
The back story here is that the system is even a little more clever
than that when it comes to redirects - if you go to a page like
oxfamamerica.org/spork/spam, and it's not found, the system looks at
the last id in the URL, in this case "spam", and tries to find any page
on the site with that id. If such a page exists, it sends you there. If
that page is a Link, it behaves like all Links, and sends you on to its
target. If two or more pages have that id, the system checks whether
one of them lives in the /redirects folder, and if so, uses that.
Otherwise, it gives you a Page Not Found error. So a lot of pages
already have built-in redirects - for example, http://www.oxfamamerica.org/water goes to the Water
Issue page, even though no "water" redirect exists in the Redirects
folder, just because it's the only item with the id "water". However,
if we made another page with the id "water", that redirect would no
longer work - so it's a good idea to make a permanent redirect, by
creating a Link in the Redirects folder, for any URL we're publishing
in print.