Forum Moderators: not2easy

Message Too Old, No Replies

Total site housekeeping/code straightener

Want to upgrade my site. Try to do away with deprec. tags etc.

         

omegaman66

5:39 am on Feb 23, 2009 (gmt 0)

10+ Year Member



OK This is going to be a pretty large undertaking because I have thousands of html pages I need to modify. Throughout this website I have lots of things like center tags and inefficennt ways of doing things that I want to fix now that I know a little bit more about webmastering and because the coding standards are changing.

What I have. On my website I have a now CSS generated menu that is deliverd via an external javascript file. I did this so I could change that one file and make additions or other changes to the menu throughout the site. The javascript refrences an external css file for the style/look of the menu.

I also deliver banners to the top and bottom of the page with an external js file, one file for the top and another JS file for the footer banners.

This keeps ad code all in a couple of files for the entire sight.

What I want to know is IF you knew what you know now how would you set up your (my) website. Things to do.. things to ovoidl

Any suggestions?

On issue I have is with IE vs FF aligning block elements. Somne pages will work best with margins fixed but others don't because they require an exact with to make them look properly.

Is the an easy way to replace the center tag with works great but is now depriciated.

And on and on. I am trying to avoid speding days fixing the site to only find a better way to do X tomorrow and have to modify and upload thousands of files in hundreds of directories all over again.

choster

7:14 pm on Feb 23, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I would look seriously at implementing a content management system so you are not managing so many static files. For the time being, HTML Tidy might help you find deprecated code and clean it out, but in the long run generating the pages dynamically will save you a lot of headaches and human error.

By the way, when you write "CSS generated menu" I assume you mean "CSS-styled" as CSS cannot (in practical terms) generate a menu. Making your site navigation Javascript-driven with no fallback is not advisable; spiders cannot interpret Javascript and would not be able to penetrate your site deeply, and you make the site inaccessible to anyone with Javascript turned off or heavily filtered. Any CMS should be able to generate HTML menus, obviating the JS, and would be another reason to move in that direction.

omegaman66

7:48 pm on Feb 23, 2009 (gmt 0)

10+ Year Member



I would look seriously at implementing a content management system so you are not managing so many static files. For the time being, HTML Tidy might help you find deprecated code and clean it out, but in the long run generating the pages dynamically will save you a lot of headaches and human error.
By the way, when you write "CSS generated menu" I assume you mean "CSS-styled" as CSS cannot (in practical terms) generate a menu. Making your site navigation Javascript-driven with no fallback is not advisable; spiders cannot interpret Javascript and would not be able to penetrate your site deeply, and you make the site inaccessible to anyone with Javascript turned off or heavily filtered. Any CMS should be able to generate HTML menus, obviating the JS, and would be another reason to move in that direction.

My website is an old one and the spiders don't have any trouble locating all my pages. The main pages has a javamenu (not spiderable) but there are also links to the next level of pages. And those pages have regular link to subpages and on and on. So there are links other than the menu javascript menu that would always allow someone to drill deeper but sometimes maybe not back further out in some situations. Most people have JS so I am not worried about switching the menu for that reason. All pages have a link at the bottom the the main page hard coded in. But I am certainly not opposed if there is another alternative.

Requirement menu must be easily changed across the website by modifying a single file. Can not require the changing of page urls. example moving to server side includes or php.

Yes menu is css-styled now and called via javascript menu.

The browsers can't follow my ad links due to js which is a good thing.

Does anyone have a defualt css that is applyed to every page to get IE and FF to work better. I have read that but don't have the link anymore to what that code should be.

g1smd

11:58 pm on Feb 23, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



*** On my website I have a now CSS generated menu that is deliverd via an external javascript file. I did this so I could change that one file and make additions or other changes to the menu throughout the site. ***

Look to using a PHP (or other type of) 'include' system, to generate the HTML for the menu, and use CSS to style it. Such a system needs only one PHP file for the entire site. I would avoid javascript for generating a menu in the browser, as bots do not always read such code.

D_Blackwell

3:40 am on Feb 24, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm with g1smd all the way. Menus, headers, footers - even sidebars, or multiple sidebar blocks (essentially an entire column) for some sites. Anything reused on all or many pages gets its own PHP file and then is handled as an include.

omegaman66

4:55 am on Feb 24, 2009 (gmt 0)

10+ Year Member



Thanks for the help. Question. Can... and if so how do you include repeated stuff as an include within an html file? I can do it with shtml, or php but that isn't going to happen. Can this be done when the file extention ends in 'htm'? Not going to trick the server into handling htm files as php either, so that is out.

tangor

6:39 am on Feb 24, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Also look to SSI (server side includes) if PHP is not available, or you are not using it for your menu, header, and footer support.

Most editors that handle HTML files have extended search and replace function if you really want to deal with those <center> tags. If it were me, I wouldn't worry about OLD PAGES, just make all new pages to the new standard. At this time there is no browser out there that does not honor the deprecated tags (that I know of, or care about).

omegaman66

7:43 am on Feb 24, 2009 (gmt 0)

10+ Year Member



I have some parts of the website as php. And SSI is available. But the only way I know to use the power of that in an html page is to rename the page so the server process it before sending out the page or you have to tell the server to handle html files as php.

The reason I don't want to do that is because I don't want to lose links and have to deal with search engine losses.

The center tag imho is the best freaking tag ever made. Why those idiots want to depreciate it when doing so causes webmaster to have to jump through hoops to get everything to work correctly in the IE AND Firefox at the same time.

swa66

1:03 pm on Feb 24, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You should be able to configure your web server to allow SSI (and even php) on every .html page. [At least for apache, don't know about other web servers]

When you are going through it: make sure to not trip IE6 into quirks mode, it'll make a.o. the centering using auto margins work properly in IE6 (most of the time at least).

The reason for <center> to be depreciated is simple: it's layout, not semantic and hence will not have room in the future of html. Some might even argue it should never have been added.

omegaman66

7:36 pm on Feb 24, 2009 (gmt 0)

10+ Year Member



I don't get the whole idea behind all this semantic stuff. I just want a tag that will center a block element... left right center, is that so wrong! hehe. I guess I need to start a movement to bring back the center tag into good standing.

Center should be the defualt for all block elements and then you can move them left or right on the occasions when you need that.

I find it funny the IE got it 'wrong' where as firefox got it 'right' yet IE implementation was easier to work with.

[edited by: swa66 at 11:27 pm (utc) on Feb. 24, 2009]
[edit reason] ToS #4 [webmasterworld.com] [/edit]

g1smd

7:40 pm on Feb 24, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Set it so that URLs ending .html .htm and .php are parsed for any PHP instructions inside.

It's one (maybe two) lines of code in your .htaccess file.

As for center tags, it is much better to use one line of code in the CSS file than hundreds of center tags all over your site. Mark up all your content using heading, paragraph, list and table tags. It makes things a lot easier in the long run. I haven't used br, font, or center tags in years.

omegaman66

10:51 pm on Feb 24, 2009 (gmt 0)

10+ Year Member



I don't want to add the burden to the server to have it have to parse html files. Nothing wrong with that just I want to keep things generic. And I want to be able to edit files on any computer and test them out on any computer before putting them on the server.

Thanks to everyone for the responses.

g1smd

10:55 pm on Feb 24, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Install some variant of Apache and PHP to test your files via
http://localhost/
- there are even versions that will install to, and run from, a USB memory stick.

omegaman66

1:00 am on Feb 25, 2009 (gmt 0)

10+ Year Member



sometimes I have to do this from computers that I don't own. If the website was already setup that way I would just make do when I am on other computers but I am not going to purposely set it up that way.