SERC > SERC Content Management System > Links and More

# Links and More

Next we'll tackle making links and the mysterious hidden tag.

The preferred approach to adding links within the cms is a format like this: [link url 'link text']. As you might guess the 'url' should be replaced by the actual url you'd like the link to point to, and whatever appears between the single quotes as 'link text' will be the text people actually click on. The variants [rightlink url 'link text'] and [link url 'link text' new] create links that are right justified and links that will open in a new window (which you should almost never do).

The w3c provides some useful guidelines for writing effective link text.

While creating links to outside sites is (hopefully) unambiguous; e.g. [link http://google.com 'link to google'], there are choices to be made if you're linking to other pages within SERC websites. Here are some guidelines:

1. When linking between pages in the same module (whose urls only differ after the last /) just use the last bit of the url of the targetted page: [link page2.html 'link to page 2']
2. When linking to an existing page that's on the SERC server but part of a separate project, build the link from the 'server root' starting with a '/': [link /introgeo/models/index.html 'Starting Point Models']
3. When linking to a page within the same project you might want to link to the development version of the page: [link /dev/introgeo/models/index.html 'Starting Point Models']. Presumably if you're working on a dev page it makes more sense for your links to point to the other dev pages, rather than the live ones so you can test drive the dev site and really see how all the links will work. Happily when you make a page live all links will automatically have /dev removed so that your live page links will point to their live counterparts.
4. You can link to locations within a specific page using an anchor syntax (familiar to those html aficionados among you): [link #midpage 'Jump to mid-page']. This is dependent on the existence of an anchor with appropriate name being added to the appropriate point on the page. In this case [anchor 'midpage'] would do the trick. In addition to linking to locations in the current page, you can point to (previously marked) locations on other pages by adding a # followed by the name of the anchor to the end of the normal link url for that page.
5. Avoid using the entire address for links to SERC pages: [link http://serc.carleton.edu/introgeo/models/index.html 'Starting Point Models']. While it will work it's unnecessary and can lead to some confusion (for reasons we won't get into here). Use the format in bullet 2 above.

It's also possible, when you just want a click link to an outside website, to use the simple syntax [url] like this [http://google.com]. This will make a link whose text is the url itself: http://google.com

The [hidden 'text'] tag, and it's counter part [end hidden] are used to surround text that we'd like to have hidden except when the user explicitly wants to see it. It creates a single link labelled 'show text' (where the word text is replaced with whatever 'text' you put between the single quotes in the starting tag). When the link is clicked it expands to reveal everything between the hidden tags as well as a link to hide the material again.

« Previous Page Next Page »