Hey folks! Sorry it’s been so long since the last update, I just got back from a trip to London and now it’s back to the real world for little ol’ me. I hope everybody has been well and is ready to jump in with some more PBwiki tips…
In the past week or two, I’ve seen a lot of questions from users on the forums about how to link from one page to another, link to somebody’s e-mail address, or to do special things like open in a new window or break out of frames. Those options are all available for folks in both the Classic WikiStyle Editor and the newer Point and Click Editor.
First off, we’ll briefly review links in general for our newest users…
Links in the Point and Click Editor
The P&C editor has a very easy way of creating links. By clicking the Link button in the toolbar, the following window appears:
From there, you can choose to link to WikiPage (another page in your wiki), URL (another link elsewhere on the Internet, like Google [http://www.google.com]), or Email (an e-mail address like firstname.lastname@example.org).
If you choose WikiPage, then you can either select a page or have it link to a new (non-existent) page. The Link text refers to the label that will be used to link that page, which defaults to the name of the page. For example, when I linked to Google above, I labeled it using its address, but I could just as easily have done this: Google!
URL is a pretty self-explanatory category, allowing you to link to pages elsewhere on the internet. Email has a couple different options, but the only necessary one is the E-mail Address itself (setting the Message Subject has its uses, but Message Body is not as useful).
A completely different way of linking to other wiki pages is to use [brackets], a legacy feature of the WikiStyle Editor. When you type in a word with brackets, anwill appear. Right-click it and you will have an option to turn it into a link. If you like the feature, you can also choose to have all words you bracket turned into a wiki link automagically.
Links in the Classic Editor
On the original editor, the main way of linking is either with CamelCase (capitalized words with internal capitalization, e.g. ThisIsACamelCaseWord) or [brackets] (similar to the way described above). Because there is not the Link text option like in the new editor, people could specify separate labels inside the brackets with a | (vertical bar). Thus, [http://dochuyen.pbworks.com|My Page] rendered as My Page. Also, things like URL’s and e-mail addresses automatically converted into links. The full feature-set is described at http://yummy.pbworks.com on the WikiStyle pages.
But now that I’ve described all that stuff, some of you may want to try something a little more complicated…
Advanced Stuff: Using TARGET
On a rendered page, the links transform into HTML <a> tags, like so:
<a href=”http://dochuyen.pbworks.com“>My Homepage</a>
In this example, the link will go to “http://dochuyen.pbworks.com” and the displayed text will be “My Homepage”. The <a…> and </a> portions define the beginning and end of a tag.
Why am I explaining this? Because savvy users can add more stuff into the opening <a…> tag that allows them to change the target of the link. It can then open in a new window, a specified frame, etc.
Point and Click users can find the code in their SOURCE and then insert the bits you see below. Classic Editor users will need to completely replace their code with the HTML equivalent (the classic editor allows insertion of raw HTML directly into the editing window).
1) Opening in a new window
Let’s say you want the link to open in a new window, preserving the current window.Â Use this code (new portion bolded):
<a href=”http://www.google.com” target=_blank>Open Google in a new window</a>
Which looks like:
The target property tells you where the link will go. If there is no target property, the default is to the same window. In this case, the _blank keyword says to go to a new blank page.
2) Breaking out of frames
Some folks have been using the wikilet feature, which allows you to embed one wiki page in another, but links open in the same little frame. How do you prevent that?
<a href=”http://yummy.pbworks.com” target=_top>Yummy!</a>
If this link is inside of a frame, it will still open into the full page. The _top keyword says to open the link on the top level of the given window.
3) Open into a frame
Others may create frames and wish that they could make links open only in the frame, like the following example (clicking the links above the iframe will open links inside the iframe).
It’s easy. First, just give your frame a name:
name=”bob” src=”http://yummy.pbworks.com” style=”width:100%; height:400px”>
Then, when you make your links, just make the target point to that name:
<a href=”http://blog.pbworks.com” target=”bob”>Open me in a frame</a>
Neat stuff, huh?
That’s probably about as much about links as you’ll ever want to know. That said, if you still have questions, on this issue or others, please e-mail me at email@example.com or contact PBwiki directly at firstname.lastname@example.org
Thanks everyone, and see you soon!