Russ Lipton Documents Radio ...

Creating A Link To Your Home Page

(Caution: some HTML ahead! You don't really need to know any HTML to experiment with this topic. If you want to learn some HTML, try here. I do recommend that you back up your important Radio files before you try this. If you accidentally smash your main template file, you can then copy it back and recover your look-and-feel. I'll show you how to do that at the end of this topic. The benefit to working your way through this topic is that it will enhance your confidence in later modifying this and other templates to change the look of your website to suit yourself.)

Of course, all your public, upstreamed weblog pages already have an active link to your home page. Did you know that? The active link is the title of your weblog. Go ahead and click on it. The problem is that your occasional visitors (yeah, I know, everyone comes to your site dozens of times a day) may not know this.

Mind you, if you stick to weblog posts rather than stories, you will never encounter a problem. Your visitors will always be oriented to your home page. But if, like me, you want to create persistent stories, the lack of an obvious link-to-home button can be confusing. (See What Is The Difference Between Posts and Stories? if you need more enlightenment on that topic).

Here is my own method for adding such a link to support story publishing.

1. Either create a graphic and/or decide on a text label you will use as your link. I chose to use the same 'Mr Natural' graphic that I use on my home page but to define it within a smaller space as I will explain shortly. I decided to create a separate text link as well. The final look I wanted is shown below:


2. I will assume that you will want to place your link at the bottom left of each story just as I did. This is the easiest way for me to help you imitate my steps. Later, you can improvise on your own. Go to the Prefs page from the Radio Menu and select 'Main Template' from the Templates section:


The 'Main template' affects the look-and-feel of all the internal pages in your weblog - that is, everything except your desktop (local) and public home pages.

3. I have entered this text for the link to home page:

<p> <a href="<%radio.macros.weblogUrl ()%>"> <img src="" border="1" width="19" height="28"> </a> <a href="<%radio.macros.weblogUrl ()%>" style="font:12px comic sans MS, arial,helvetica">&nbsp<-- Return to Home Page</a></p>

Look for that text in the screen capture below:

(Your main template code will probably look somewhat different, depending on which theme has been applied to your weblog. However, each Radio theme uses a <%bodytext%> macro. You will insert your link to a home page graphic and text relative to that macro within your own main template. See What Is A Macro? for a simple definition).

Note the following carefully:

3a. I placed the text just below the Radio bodytext macro: <p><%bodytext%></p>. Radio places the text of your stories inside that macro. So, by placing my link to home page just after the bodytext macro, I ensure that it will be located at the bottom of my screen (e.g., following the text of each story).

3b. Don't worry too much about the syntax subtleties of this first text: <a href="<%radio.macros.weblogUrl ()%>">. This is also a macro. It 'knows' how to find your user number and create the right URL so that a link goes back to your home page rather than, say, mine.

3c. My graphic is defined within this text: <img src="" border="1" width="19" height="28">

You will need to save your graphic file to an appropriate location in your local www folder. I would suggest dropping it into the already existing 'Images' folder. (I created a separate myImages folder since I manage lots of graphics for this weblog). Upstreaming must be turned on so that Radio can publish your local graphic to your external Internet site. 

Copy and Paste Graphics shows you how to copy an actual graphic into your weblog. Copy and Paste URLs will show you how to find the URL for your graphic file. That is what we want to do here. You want to create a text statement just like mine above but with the URL of your graphic substituted in place of mine.

You can keep or modify the border, width and height setting shown above. Personally, I think the size of my link graphic is just about right. We don't want it to dominate the story text.

3d. When you combine 3b and 3c, you end up with the complete graphic link text: <a href="<%radio.macros.weblogUrl ()%>"> <img src="" border="1" width="19" height="28"> </a>.

If you don't also want to create a text link, you're done. I felt I needed a text link as well to make sense of the graphic. Alternatively, you could skip 3b, 3c and 3d and just go to 3e below if you don't care about having a graphic link.

3e. The complete statement for the text link back to my home page is: <a href="<%radio.macros.weblogUrl ()%>" style="font:12px comic sans MS, arial,helvetica">&nbsp<-- Return to Home Page</a>

Notice that we use the same Radio macro that we used in the graphic link: <%radio.macros.weblogUrl ()%>. After all, we want the reader returned to our weblog home page whether they click the graphic OR the text link.

I could - but won't - bore you with the arcana of the codes in that statement with two small exceptions ...

... the &nbsp forces a space between the graphic and the text link for the sake of giving a nice appearance.

... my actual link text is <-- Return to Home Page. Of course, you can do the same or create something different.

4. When you are satisfied with your work, click Submit at the bottom of the Main Template box to make your changes effective.

5. You won't be able to see your changes until you create a new Story. Changes made to the Main Template do not affect your weblog home page but other pages internal to your home page.

6. In order to propagate your changes to all the stories in your weblog, you will need to republish your weblog and make sure that every existing story is 'touched'. You must open each one and edit it - then repost.

In Case Of Disaster, Break Glass And Pull Alarm ....

If you ended up trashing your Main Template without knowing why-or-how, your weblog may look weird. To fix this, you need to do the following:

1. Turn upstreaming off.

2. Exit Radio.

3. Go to the backup copy of your WWW folder. You will have done this when backing up your files. You did back them up, right? Copy-and-paste the #template.txt file from the backup www folder to replace the one in your actual www folder (the www folder in your current Radio Userland folder).

4. Launch Radio.

5. Turn upstreaming on.

6. This should restore the main template as it was before you began your experiments.

© Copyright 2002 Russ Lipton. Click here to send an email to the editor of this weblog.
Last update: 06/12/2002; 12:17:54 PM.