Tutorials/Making a News Box
From CGWiki
Adding a generic news box is fairly straightforward. You are not just limited to news, you can put simple blog-type information or anything else that takes your fancy.
This tutorial will show you how to add a box on your indextemplate that will let you share news and information from a single source without needing to go through siteadmin to trigger an update.
Note: As of about August 2007, there is some debate as to whether or not this system actually works. If it does or does not will depend on the permissions for your account in Comic Genesis. For most new people, when they try to create a new fie / folder in the public_html section, they'll get a "Permission denied" message.
Possible Workaround: Try creating the news.html file in the workspace/webpages folder and then let the server update. Once it's in the public_html, try overwriting the public_html version directly. If you can, great!
Contents |
Step the first
To begin with, you'll need to create a file. For this example, we'll use news.html (it does not have to be html, it can be a text file but html is easier and more flexible).
Note: This page does not need the advertisement or the hosted message, because it will be displayed inside an existing page (your index). Also note that Keentags will not work with this file as they will not be passed through the server.
There are two ways to set news.html. The first is to just have the information that you want:
Day one: My site is up. w00t!
This way will make the box show up as flat white with black text (or whatever default the reader has set), which may or may not look good on your site.
The second way is to set the html document as a proper html document so that you can set the colours, fonts, use css etc. Note that anything you set on the main page (indextemplate.html) will not affect the look of news.html. So if you make text green in your template, it won't make any difference to the news box. So you will need to set the colour in news.html. The easiest way is to just link to the same stylesheet (if you use one).
<html> <head> < link to css > </head> <body> Day one: My site is up. w00t! </body> </html>
Note that the <title> tag in the head won't do anything in an this news box.
Step the second
Once you have your news.html file set up the way you want it, you will need to edit your indextemplate.html file. Note that it's not advisable to add the news box to the dailytemplate.html file.
Pick the spot in your template where you want the news box to show up. For this example, we'll assume that the size available is 400 pixels wide and 200 pixels high. In the spot where you want the news box to appear, add the following code:
<iframe width="400px" height="200px" src="/news.html">Your browser doesn't show iFrames</iframe>
You can change the width and height to suit your needs. If you want to see what other options are available, run a search for "iframe tutorial" in you preferred search engine.
Step the third
Once you have your indextemplate.html file set up, connect to your account via ftp and upload the indextemplate.html file to it's place in the workspace folder, and the news.html file to the public_html folder. The news.html folder should end up sitting right next to your index.html file.
The reason for this is that you want your news.html file to be accessible directly to your readers.
You now trigger an update to get your indextemlate.html file to show the new version. Note that you can do an Index Update instead of a Regular Update, or just wait for your comic's next automatic update.
Updating with new news
When you want to add new information to news.html, edit the version that you have on your computer then ftp it to your account and replace the old version. That's it!
You will not need to trigger any updates!
The new version of news.html will show up inside the comic's index straight away. And that's the biggest advantage of this method. If your comic isn't updating for whatever reason, you can let your readers know straight away without having to trigger an update.

