Samisite Webmaster Community Forum

SPECIAL TOPICS => Website Building - Best Practices => Topic started by: Samrc on October 16, 2007, 07:30:24 PM

Title: NAMING of files, pages, images, just about everything.
Post by: hidden on October 16, 2007, 07:30:24 PM
CSB (and the old Trellix as well as many other programs) will allow you to use non-standard naming and often there will be no problem because the program tries to cover for your error.  But eventually those little mistakes can cause you to have complicated problems with your site.  

Best way to avoid problems?  Follow standard naming practices for page names, downloadable files, music, anchors, subdirectories, images, and ANYTHING YOU POINT TO that can become part of a webpage address.

 

So what harm could there be?  Besides problems with linking, bad formatting can have more drastic effect on your website.   Simply put, Code can break, links can not work and give you 404 errors and of course, you can get that nasty dreaded red x.

 :ximage:


---------
CSB SPECIFIC information below:

So what harm could there be?  Besides problems with linking, bad formatting can have more drastic effect on your website.  Recently a site was reported to have images disappear for no good reason. Nothing unusual about the last update, just that images were missing from many pages. After researching and testing it was discovered that poorly named anchors that had worked for months caused a corruption in the coding of the web pages produced by the tlx design file. The final straw was one anchor that had spaces, symbols (like !)(&) and caps. Once the bad anchors were removed and replaced with properly named anchors and links were reset, the published pages regained the images that had been lost. The code in the published page was corrected by CSB.

Page names are assigned by the program idxx.htm where xx is the id number.
   To change that name to a text name that makes sense:
   - Right click the page
   - Choose PROPERTIES, PAGE  (or from the toolbar choose EDIT, PROPERTIES, PAGE)
   - On the FIELDS tab, put a name into the SHORT TITLE field.  
   (Example: type in contact and it becomes contact.htm when you publish the page)
   - Click APPLY, OK

Note that CSB tries to correct the poor formatting for page names and anchors because this information will become part of a webpage address and browsers do not accept spaces or symbols.

type in contact and it becomes contact.htm when you publish the page
type in vacation 2005 and it becomes vacation_2005.htm when you publish the page
type in sales $ 2005 and it is translated to sales___2005.htm when you publish the page    
spaces and symbols are replaced with _ to correct your error

ANCHOR NAMES are suggested from text near the anchor placement, but the webmaster has control over what the program uses for the anchor.  

If the program suggests order #2295 from a list closest to the anchor, you should use one of these:
     order2295    or   order_2295     or simply   2295  

If you try to use order #2295 as suggested by CSB, the program will accept your choice! Then it will try to translate that choice to become order__2295 to replace spaces and symbols with acceptable code.  Any link to the anchor that is placed via code must reflect CSB's version of the name or the link will fail

PAGE TITLES come from the TITLE field.  Do not confuse page titles with page names. VERY Different.
Page TITLES will NOT become part of the webpage address. They are seen at the very top of your web page window in the TITLE Bar (has the X to close the window). You can have spaces and caps in your titles and many people use symbols also for effect. That's fine! CSB does not modify what you put into the title field.  Warning: Some Site Map Generators that use the TITLE field give wacky results if you use symbols but spaces will not be a problem.

CORRECT EXISTING ERRORS:   Before making any drastic changes to a site, MAKE A BACKUP of your file.
If the page has already been published a while and you try to correct it now, you need to protect incoming links.
Open the page in your browser window. Look at the address that CSB created for you in the address bar of your browser window. Correct your error by just putting CSB's version of the page name into the SHORT TITLE field. Typically, replace each SPACE or SYMBOL with an underline. Now you have proper naming AND your links are intact. No one will receive a 404 (page not found error) but your file is cleaner and going forward, continue the practice of proper naming.

If you named your page vacation 2005 with a space in it, CSB created the page vacation_2005.htm when you published.  Change the SHORT TITLE to vacation_2005  

If you named your page sales $ 2005 with a space symbol space in the middle, then CSB created sales___2005.htm when you published. Change your SHORT TITLE to sales___2005 (with 3 spaces!)

Anchors follow the same guideline but for BEST results, you really should remove the anchor (deleting the links) and replace with a properly formatted short anchor name.  I have seen some anchor names that are practically a sentence, with spaces, symbols and even exclamation marks!  Anchors like this can REALLY cause havoc with the generated code and should be replaced. Will it ALWAYS cause a problem? NO. When it does, is it bad? YES!  Warning: if an incoming link from someone elses's site has linked to an anchor on the page, the link would be lost. They should be linking to your PAGE not the the page and anchor.  To minimize problems, you might check with your site statistics to see who has sent you traffic and check how they link to you and let them know about the change if it affects their link.

Many hosts also allow you to set redirects through the control panel, or other methods when necessary.

If you choose to not make any corrections, your site may continue to publish just FINE for weeks, months, years. Or not. No way to tell.  It's your choice to fix or leave it as is.  If you begin to have mysterious things happening (like the suddenly missing images, etc) check your page and anchor names and correct them immediately. In any case, you should go FORWARD with proper naming structure for any NEW pages, files, subdirectories and anchors!

Allowing CSB to correct you is bad practice for two main reasons:
1) CSB can not always correct your error or there are too many errors and in either case, you can have major errors in the HTML that is generated which can cause improper page loading, missing data, etc.

2) Your technique is incorrect and if you try to use a file name (music, pdf, image, etc), page name or page name and anchor in an inserted code (slideshow, flash, rollover, or any other inserted code) the code will fail and you will not know why.  Using proper technique while building the site helps to prevent this problem.

In a menu code you call for a page name http://www.yourdomain.com/My Page.htm and the link does not work. That space in the name will cause the link to be broken generating a 404 error.  
http://www.yourdomain.com/$sales.htm has no space, but the symbol is improper.

Anchor names are included in the URL also. Links to improper anchor names will fail and you will not know why.  Again spaces and symbols interfere with browser function.

In a code you call for an image myimage.jpg, but the image that you loaded to your site was actually named MyImage.JPG, seen as a different file on many servers.  The dreaded little red x appears on the webpage instead of the image. Correcting the name of the file so the code and the file are the same fixes the problem and using all lowercase makes it easy to remember the file name and resolves the problem of moving to a different server sometime in the future.

Quote
quoted from the thread on the old forum: Pics wont load by Dianne O'Donnell 7. Mar 16:49  

pruned from the Hi,
Can somebody please help....??
I am at my wits end trying to get my sites to publish with the jpg's and gif's.
When publishing, the transfer seems to stop and soon as it gets to the first pic on the site. Therefore the sites are full of RED X's. It is happening with all of my sites, and I cannot work out why.... If yu have a look at http://www.greyhoundpets.org.au you will see what I mean. Really hoping someone out there can help as I am becoming desparate to fix the problem...

Thanks heaps
Dianne
-------------------------
several posts later...........


Ok... Some of the problem (and may be the main problem) is your anchors.

During test publishing your file WITH frames to my test area, I came into several errors. When I checked those pages I found anchors that were not made properly.

IT IS A COMMON MISTAKE...mainly because the program does not alert you when you make the anchors! It allows you to name them anything so how would you know any different! :)

I sent an email to you about this. This is an exerpt from the email:

Standard naming for page names and anchors: lowercase, no spaces, no
symbols except _ if necessary. You broke ALL those rules and the & ?
symbols are the worst violation. HTML can not contain those in links,
url addresses, etc! So CSB struggles with how to translate the bad
input into HTML code that will work (the program is too good to us
sometimes, correcting our mistakes as best it can and this is one of
those times).

examples:
anchor name you made: Care & Feeding
csb translates to this: id267_m.htm#care___feeding

anchor name you made: Missing Your Socks ?
csb translates to this: id267_m.htm#missing_your_socks__

All your anchors need to be corrected! ASAP.

First, insert new anchors beside the old ones. Then tweak your links
to the anchors and switch them over to the new anchors. Then you can
remove the old anchors.

BETTER YET but more time consuming... MAKE A NEW PAGE with the new
anchors, change your links to the new anchors on the new page, then
DELETE the old page with the anchors. If you have several pages with
anchors, replace each of the pages. You can COPY or MOVE content from
the old page to the new, but be careful...DO NOT copy or move the old
anchors to the new page!!! It's a pain, but also the most reliable
and expected to have the best results! After deleting the bad pages
FILE SAVE AS and rename to compact the file and get rid of the of the
old unused code. DO NOT TRY TO PUBLISH until after you do that!

Chances are, if you fix ALL the anchor names and FILE SAVE AS the file
with a new name, your main corruptions in the file will be cut out.
You can then uninstall the program, reboot your machine, then
reinstall and try again. I know the corruptions in the file are
definitely related to anchors... you may have other things going on,
but that's a BIGGY.

Let us know your progress.
-Samantha

---------------------------------

YOU are a little bottler !!!!! (Aussie slang for a champion)....

You are spot on - removing the anchors and replacing them has worked. I have never thought change the anchors, as Cutesite always picked up the text behind the cursor...Have a look now !!! It is back to normal......
http://www.greyhoundpets.org.au
The greyhounds and I thank you from the bottom of our hearts...... and Greyhounds have BIG hearts....I must apologise for taking up so much of your time, especially when it boiled down to my ignorance...... but I would have never known, without your help..........
I wish there was someway I could repay you - if there is - please do not hesitate to ask....
Once again - thanks so very much.
Have a nice day
Dianne....