Comments? Email me: tar@durge.org |
More on the basic hitop tags.Stop Press!A new version of hitop has come out! It can now handle tags in strings, though they are severely discouraged. Come back soon for a rewrite of this section! Everything we've done is wrong...Ok, I'm exaggerating. I'm going to show you a problem with using @SET for certain things. You'll remember the example source file from the previous session used:
This works fine, but isn't the best way to do this. Why? Well, I'll show you... Try altering that line of your file so it looks like this:
You could quite possibly want to do this - my index page breaks the main title into two lines. Save this new file as hellobreak.hitop and make the corresponding html file, just like we did last time:
Now try looking at that page. It should look something like this example. Something has gone wrong... The No, really."> is what hitop spat out - it parsed the @SET tag upto the first >, and what was after it was spat out before the template was used. (This is why it appears at the top of the page, not later on.) So, now you know: Do not use HTML tags in a @SET tag. There is, happily, an easy way to do this. It involves using the other tag we know of, @DEF. As you remember from the last session, @DEF is what we used for the bodytext. This is because you can use HTML tags between a <@DEF> ... </@DEF> pair. I'll explain why later. For now, let's fix our example. Open up hellobreak.hitop again. We want to change this bit:
We need to use a @DEF, like this:
Save your edited file as hellofixed.hitop but don't try to hitop it yet. Why? Well, it won't work... Remember our template file? We have to change that too - at the moment, it's expecting something it won't get. Open up template.hitop and change this line:
It needs to look like:
Save this file as template.hitop (we're going to stay with this style) and then type at the command prompt:
The new page should look like this example. So, boys and girls, what did that tell us? At the moment, use @SET to give the title of the page (what appears in the title bar of most browsers) and use @DEF for stuff that will appear in the main browser window. Even if you don't want any HTML tags in your main title at the moment, for example, you may want to put them in later - and that is partly what hitop is about, making it easy to change your site look. So do as you're told! :) Next, we learn about NAV. It's great. It is funky! |