Tutorials/Making a News Box

From CGWiki

Jump to: navigation, search

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!

New System: As of March 2009, the system that was described in this tutorial stopped working. This is because new users no longer have the capacity to edit the public_html section of their comics (this was due to a large number of users breaking their comics and needing repairs!). The new system is described below. Old information has been deleted, but can be accessed by looking at the history of this page.

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. This can be done simply by adding some new declarations to your stylesheet. If you don't know how to do this, you can run a search for "css basics" and use a stylesheet just for the news file.

Note: If you are unsure how to do this or can't figure it out, pop into the Help Centre and ask.

Step the second

Now, you will need a place to put the news.html file. You have two options:

  1. Put it in the workspace/webpages folder. If you do this, then the server will automatically move it to the right place and you'll be able to link to it with src="/news.html" - plus you will have everything in one place.
  2. Sign up for another free host that lets you host text files and link to them from another site. Ripway.com is good and works quite well.

What's the difference? Putting the file into workspace/webpages has the advantage that everything is in one place. If you use an external host, then if the Comic Genesis update system stalls and your comic does not update, you can update the news.html file on the other host and it will instantly update on your comic. You can keep your readers in the loop and don't need to wait for your comic to update.

Step the third

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="LINK">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 fourth

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. Change the word LINK in the example above so that it points to where your news.html file is. If you upload it to the workspace/webpages folder, then LINK would be /news.html and if you used an external host, then LINK would be http://urlofthehost/yourusername/news.html (note that the exact link will vary depending on the host you use).

You can 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 use ftp to replace the old version. That's it!

If you uploaded it to a separate host, 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.

If you uploaded it to workspace/webpages then the new version will show up after the next update.

Return to the Tutorials page