Goodies to Go (tm)
February 10, 2003-- Newsletter #219

By Vince Barnes



Goodies to Go (tm)
February 10, 2003--Newsletter #219

This newsletter is part of the internet.com network.
http://www.internet.com
 


Featured this week:

* Goodies Thoughts - Web Site Maintainability.
* Q & A Goodies
* News Goodies
* Feedback Goodies  
* And Remember This...

 


 

Goodies Announcement

Just in case you missed it before, the new Beyond HTML Goodies book is now available!

 

Go beyond the basics and learn how the pros add and use dynamic HTML features and advanced JavaScript techniques. Beyond HTML Goodies demonstrates dozens of new and different features readers can add to their existing Web pages using HTML and JavaScript. The book starts with simple text and image tips, such as adding a clock to a Web page or causing text to appear when the mouse moves over an image. It gradually builds to more complex tricks, including manipulating forms or working with cookies behind the scenes. Throughout the book, readers enjoy Joe's snappy style and "to the point" discussion of each "goody" in the book.

 

http://books.internet.com/books/0789727803

 

 

Goodies Thoughts - Web Site Maintainability.

This week I am concluding my series about the early stages of a web site's development with a look at maintainability. I hope you have found this series to be helpful and interesting. While the primary purpose of this discussion is to aid those who are just beginning in this type of venture, it would serve those of us who are a little more seasoned well to remember some of the points raised. I know that writing these pieces has reinforced in my mind some of the golden rules -- some of which are all too easy to gloss over as tasks become more routine.

In case you're just joining us - welcome! -- you can find the earlier pieces in current year's Goodies To Go Archives at http://www.htmlgoodies.com/letters -- this series began in January with a look at "The Importance of Design". These articles, together with some other material, are also being incorporated into a new section of the HTML Goodies website. Dubbed the "Non-Tech Intro", it is designed to help someone from the first idea of starting a website through to where they need the primers to learn HTML coding. If you know people who are starting from absolute scratch, this would be a great place to send them. Now, on to the subject at hand!

As you design and write your website, you become very familiar with the structure you use, the layout of the various pages and the manner in which you tied them all together. Time goes by; you add a little more here, a little more there and sooner or later your site has grown into something huge. The trouble is, after a while your memory of those early details fades; you forget what this was for, what that should be linked to, why these are here instead of there. Now, when you make a small change, you run the risk of all sorts of things falling apart! You have entered the "Website Maintenance Nightmare"! Please don't let this happen to you!

There are three golden rules to help avoid the nightmare, related to consistency, structure and annotation.

First, be consistent! If you use one method and style throughout your site, you will have only one method and style to remember (or to relearn!) This does not mean that everything has to look the same. It means that you should apply consistent styles and use a consistent method throughout. For example, instead of applying font styles to each piece of text on your pages, you would be more certain of consistency by applying a style sheet to all your pages and keeping your styles in it. If you don't know how to do that and are just starting out, don't worry for now - just remember it's something you're going to want to do. If you need to find out more right now, check out the tutorial at http://www.htmlgoodies.com/beyond/css.html

Another example is the use of frames. If you decide to use frames, use the same frame structure throughout. It's not wise to use a frames page here and tables there, accomplishing a similar layout. Choose one, and use it throughout. Again, if you are new to site design, just hang on to this thought. When you have gone through the tutorials, you will have encountered both frames and tables. A little experience will give you a feel for the virtues of each and you'll be able to make your choice. The trick here is to stick with a consistent method. This of course, does not mean that you should not use both frames and tables. It means you should not use both to accomplish the same thing. For example, don't create a table on one page to hold a menu on the left side of your page (like the one on the Goodies site) and hold it in a frame on another page. As you develop pages, you will know when you are encountering something similar to something you have already done. When you do, do it the same way (or, if you have found a better way, change every instance to the new way!)

The structure of a site is usually determined by the nature of its content. The trick here is to create a folder (directory) structure that matches the content structure. For example if you are creating a photo album and have different page sets for each year, keep the sets in folders named for each year. Remember to use consistent names such as /1999/family and /2000/family and you will be able to match your site navigation to your folder structure. It is also a good idea to ensure that you don't crowd out a directory. Keeping certain files separated helps. For example, if you use Server Side Includes to help with consistency (a very good idea - see http://www.htmlgoodies.com/beyond/ssi.html) keep all your "include" files in a folder named ssi - be sure to include the path in references to them! I also like to keep images in a folder of their own, along with the pages that reference them. For example, the folder /John contains pages about John, and the folder /John/Pics contains the images used in those pages. Jane's pages and pictures would be in /Jane and /Jane/Pics. (Note also that UNIX/Linux systems are case sensitive - they see Jane and jane as different things; Windows systems are not (by default) case sensitive - they see Jane and jane as the same.)

Annotation is simply the use of comments. Don't get caught in the trap of thinking that comments only explain your methods to strangers for them to copy. The "stranger" who will learn from the comments is most likely going to be you, a little while after you wrote the comments, when you have forgotten why and how you accomplished something but now need to change it. Trust me, you will thank yourself for leaving yourself notes! This holds especially true for programming in such languages as JavaScript, PHP and Perl. Things have a tendency to wind up with names that seem brilliantly enlightening when written, and virtually meaningless a few of months later!

If some of these notions don't make much sense to you at this point, don't be concerned. Try to keep the concepts in mind though, consistency, structure and annotation -- you will be your own best friend if you do!



Thanks for Reading!
- Vince Barnes

 

Top

Q & A Goodies

Questions are taken from submissions to our Community Mentors. You can ask a Mentor a question by going to http://www.htmlgoodies.com/mentors/.



Q.  How do I put an image on the very edge of the screen? Using the align="left," I still get a space to the left and top of the image.

A
. What you're seeing is the page margin. You can set those either in a stylesheet, or in attributes of the body tag. For example, in the body tag add:
marginheight="0" marginwidth="0" topmargin="0" leftmargin="0"
The reason for specifying it two ways is some browsers understand one way, and some the other. The zeros specify the number of pixels between the screen and the edge of the page. In a style sheet, add:
body {margin-top: 10px; margin-left: 10px}
This specifies that the page starts ten pixels from the top and left edge.




Q
. I'm setting up a news-type site, where we will be displaying articles on the main page. I want to be able to have a 'Comments' link near the article where readers can submit comments or questions relating to the article and have them automatically displayed on a 'Comment Page' instead of having questions and such emailed to us and manually placing them on the site. I'm not sure how this can be achieved. I've seen it on several other sites, but I don't know if they use HTML, CGI, or something else. I only 'know' HTML and CSS, which is probably why I don't know how to go about setting this up.

A
. What you descibe sounds like a guestbook with a different name. Yes, you need CGI or something like it, ASP or PHP. There's a guestbook tutorial on the Goodies site, and some script sites may have a free guestbook. http://www.htmlgoodies.com/primers/perl/perl03.html




Q. I am beginning a website design project and want to make sure that the site is written in standard code that will run in most configurations, and will be easy to maintain for the client. I am considering using some version of Dreamweaver (I am currently using Arachnophilia, which is wonderful but not WYSIWYG. Will Dreamweaver, in any form, create real code that can be maintained without having access to the software? Also; is there a way to allow the client to easily update information and/or post a monthly newsletter to the site without knowledge of HTML?


A. Dreamweaver will create the correct code. To maintain a web site or page, doesn't require anything other than Notepad. If you know HTML you can code the page by hand using a simple text editor. So the answer to your question is yes but a web editor like Dreamweaver makes it easier for those who do not know HTML.
To maintain the pages, there are ways to create a site that can be managed through web forms, but again you must have the knowledge to create them first. There are newsletter applications that you could install that the client can update by using forms. I use a newsletter application that I reconfigured to act like a "Featured Product" tool. The client logs into the administration area and can create, edit and delete news and featured products. This, then shows up on the designated area on their website. You can see it here: http://www.rayburnmusic.com/stage  Keep in mind that it is still a site in progress. The area on the right under NEWS is driven by a database that the client can update. If you click on the BRASS link, you can see the "Featured Product" area on the left. To use that particular application your site would have to support Active Server Pages(ASP), but there are others. The server will have to support some kind of scripts because a database has to be accessed.




Q. Is it possible to have a date field automatically filled with today's date?

A. This tutorial explains how to write the date with JavaScript, http://www.htmlgoodies.com/primers/jsp/hgjsp_3.html




Q. I'm trying to get a text block to appear over a link when the user hovers a mouse over the link. If you got to http://www.htmlgoodies.com/mentors/ and hover your mouse over the HTML Goodies logo at the top of the page a little box appears with text in. How do I do that?

A. You can do it without javascript by using the title property like this:
<A HREF="somepage.html" TITLE="Some Text">Click Me</A>
or for an image That is linkable you could do this:
<A HREF="somepage.html"><img src="pic.gif" border="0" alt="Some Text"></A>
You could also use the title property in the img tag, but the alt property will work in older NS browsers where the title property will not..




Q. Is there any way that a web page can be updated by using a simple form button? For example: a school wants to post that their school is closed by going to a page and clicking the "school is closed" button, which updates the home page.

A. You could have the part of the page where the closing notice would appear be pulling code from a server side include, and let someone have access to just that file where they can change the text. If you use the form, the form could write to a database and the display page pulls data from the database. Perhaps a server side script could write a file, which could then be picked up as a server side include. If you decide to go with a form, you'll have to use some server side script and perhaps how to hook up to a database. You would need to find out from your host what languages they support. Having users directly update the include file is the simplest to set up. This tutorial explains it:
http://www.htmlgoodies.com/beyond/ssi.html 

 

 

 

Top

News Goodies


Internet Access Via Power Lines
[February 10, 2003] The Power Line Communications Association (PLCA) is building bridges between all of those who might get involved in providing Internet service over electric power lines.

Click here to read the article



 

Macromedia Unveils DevNet, Freehand MX
[February 10, 2003] The Web graphics software firm rolls out a subscription-based sales program and an upgrade to its flagship Macromedia MX product suite.

Click here to read the article

 



Verizon-RIAA Dispute Heads Back to Court
[February 10, 2003] The phone and ISP giant appears in court Thursday, hoping to convince a judge that it should not be compelled to reveal the name of subscriber who allegedly downloaded copyrighted songs.

Click here to read the article

 

 

 

New Chapter in the Tale of the Booksellers
[February 10, 2003] Overstock.com takes aim at the King of the Hill in online book sales and undercuts Amazon.com's prices by 20 percent or more.

Click here to read the article

 

 


Pentagon Moves to Revive Funding for Data Mining Program
[February 10, 2003] Military says its will establish an internal board of senior DOD officials and an external civilian advisory committee to oversee controversial Total Information Awareness program..

Click here to read the article

 


 

Intel Powers Down its Chips
[February 10, 2003] The No. 1 chipmaker rethinks power-hungry circuits, spurring a new 5GHz Floating Point MAC as well as a 1.5GHz third generation Itanium 2 with on-die cache.

Click here to read the article

 

 

Nokia Engages New Game Platform: N-Gage
[February 5, 2003] The cell phone maker plays the part of manufacturer and game producer on its new wirelessly networked game platform all before Christmas. T-Mobile signs on for service.

Click here to read the article

 

 

Online Sales Tax? No Big Deal
[February 5, 2003] Despite all the moaning by e-tailers, such a tax is inevitable and will not impede the growth of e-commerce, says a new industry study.

Click here to read the article

 

 

Study: Online Hotel Booking Problematic
[February 4, 2003] Report from a U.K. online travel consulting firm finds that many sites produce uncertainty for consumers; a check of major U.S. sites finds clarity, however.

Click here to read the article

 

 

 

 

 


Top

Feedback Goodies



Did you ever wish your newsletter was an easy two way communications medium? Ploof! It now is!
If you would like to comment on the newsletter or expand/improve on something you have seen in here, you can now send your input to:

mailto:nlfeedback@htmlgoodies.com


We already receive a lot of email every day. This address will help us sort out those relating specifically to this newsletter from all the rest. When you send email to this address it may wind up being included in this section of the newsletter, to be shared with your fellow readers. Please don't send your questions to this address. They should be sent to our mentors: see http://www.htmlgoodies.com/mentors/



Feedback from within the ranks this week! Wally Bamberger, one of our Mentors, noticed an error in his reply to a question and wanted to share the correction with you, rather than leave you possibly mystified over a bug. Writes Wally:
In my response to a mentor question on drop down menus and the use of js files which was reproduced in the Goodies to Go #218 newsletter, item 2 was reprinted accurately as follows:
2. Insert the following (you can change variablename to whatever you want)
into the js file:
var variablename=" "document.write(variablename);
Unfortunately, for the lack of a very important semi-colon, this will break the script.
This is the way I should have written it:
var variablename=" ";document.write(variablename);
That semi-colon between the " and document.write() is needed to isolate the document.write() statement from the rest of the code and document.write()is what places the contents of the js file on the page.
- Wally Bamberger

I want to take a moment to express my gratitude to our mentors. They volunteer their time and expertise to help our readership with their questions. I for one, greatly appreciate their kindness and know that our readers do too.
Thanks also to all who sent me compliments this week. It is heartening to hear from you.
 

 

 

Top
And Remember This . . .


On this day in...


1992: Alex Haley Dies at age 70
The author of "Roots" died on this day in 1992 in Seattle. His book was made into a TV mini-series of eight parts which aired in 1977. The last episode of the series was watched by more than 130 million viewers - about half of the entire US population at the time. The series which was aired on eight consecutive nights was the most watched show in TV History. It inspired a fresh increase of interest in black history and heritage.

And a Happy Birthday today to Jimmy Durante (1893-1980), ragtime piano player, band leader, singer, actor, comedian and beloved entertainer. Happy Birthday also to singers Roberta Flack (1940 - The First Time Ever I Saw Your Face, Feel Like Making Love, Killing Me Softly With His Song) and Donovan Leitch ("Donovan" 1946 - Mellow Yellow, Sunshine Superman, A Gift From A Flower To A Garden)






Thanks for reading Goodies to Go!

 




Archive Home Page.



Make a Comment

Loading Comments...

  • Web Development Newsletter Signup

    Invalid email
    You have successfuly registered to our newsletter.
  •  
  •  
  •  
Thanks for your registration, follow us on our social networks to keep up-to-date