PDA

View Full Version : Proposed change to website.


Admiral Huddy
08-01-2007, 11:02
Ok, i've had a look at some CSS code as some of you suggested and have set up a test page with a new navigation bar.

What do you think?


http://www.admiralcomputers.co.uk/test.htm

Plan is to have this on each page.

However, it means a lot of duplicate code. Does anyone know how I can specify the the Navaigation pane in one place which is viewable on all pages. Would save a lot of time integrating or when making furture changes.

Andy100
08-01-2007, 11:18
Just opened that page on my puny 1024x768 lappy screen and it looks a bit funny.

http://farm1.static.flickr.com/150/350262378_41b9429e14.jpg

The main headings overlap the blue border and the subheadings are overlapped by the main headings.

Just a heads up :)

Admiral Huddy
08-01-2007, 11:25
Oh - I knew that they would overlap the subheading.. I thought I could make the list semi-tranparent but not sure how to do that. But it doesn't overlap the with the menu option in IE.. Must be a firefox problem?

Mark
08-01-2007, 11:43
Don't duplicate code - it makes for a maintenance headace. Use server side includes (http://httpd.apache.org/docs/1.3/howto/ssi.html) if you must. :)

Davey_Pitch
08-01-2007, 11:47
Whoops, just remembered I said I'd redo the website for you Paul :embarassed: I'll crack on with it when work is quiet and see what I can do :)

Regarding having the navigation page in one place, you'd be best doing that using PHP/ASP for it, as you can create the navigation page as a seperate file, then call that file on each and every page, but only editing the single file whenever you need to make changes. Unsure how it would look though using the CSS menu system you've got there. I'll play about with it when I get the chance and see how it works.

Andy100
08-01-2007, 11:48
Yeah seems to just be Firefox, looks perfect in ie.

Admiral Huddy
08-01-2007, 12:53
Thanks Davey..


There's so much to learn :(

Admiral Huddy
08-01-2007, 13:01
ahh .. So All I have to do is have one standard page say nav.htm, then use the following piece of code on each page where required..

<!--#include virtual="/nav.htm" -->

maybe not :(

Davey_Pitch
08-01-2007, 13:30
You'd need to make your test page into a php page, and the server it's hosted on needs to have PHP installed on it for it to work.

Mark
08-01-2007, 13:32
Huddy's (and my) suggestion doesn't require PHP, it uses SSI instead. You'll probably need to rename the files to .shtml for it to work.

If there are other reasons for switching to PHP (and there may well be), then sure, but it isn't the most optimal route for just doing includes.

Admiral Huddy
08-01-2007, 13:34
Huddy's (and my) suggestion doesn't require PHP, it uses SSI instead. You'll probably need to rename the files to .shtml for it to work.

If there are other reasons for switching to PHP (and there may well be), then sure, but it isn't the most optimal route for just doing includes.


All files to shtml.. What effect will that have?

EDIT - also, isn't the line I mentioned above just a comment line?

Mark
08-01-2007, 13:37
You'll need to change any links that use .html to use .shtml. That's about it.

It all depends on the server configuration. Most sites I know use .shtml for SSI-enabled pages, but it's possible to configure a server so that isn't required. It's mostly down to your provider so I can't say what is likely to work and what isn't.

Davey_Pitch
08-01-2007, 13:40
Huddy's (and my) suggestion doesn't require PHP, it uses SSI instead. You'll probably need to rename the files to .shtml for it to work.

If there are other reasons for switching to PHP (and there may well be), then sure, but it isn't the most optimal route for just doing includes.

Assuming Huddy's server is already set up for PHP (and most paid for servers seem to be), then all he'd need to do is use

<?php include("nav.php"); ?>

And make a nav page called nav.php (which would really be nav.htm simply renamed to .php).

Admiral Huddy
08-01-2007, 13:42
Assuming Huddy's server is already set up for PHP (and most paid for servers seem to be), then all he'd need to do is use

<?php include("nav.php"); ?>

And make a nav page called nav.php (which would really be nav.htm simply renamed to .php).

that would be lovely.. Yes my provider is php enabled :)

do you have any php code sor site vav as I have?

edit - sorry I mis read your post.. just rename the nav.htm file to php?

Davey_Pitch
08-01-2007, 13:45
that would be lovely.. Yes my provider is php enabled :)

do you have any php code sor site vav as I have?

edit - sorry I mis read your post.. just rename the nav.htm file to php?

Yup, and you'll need to rename your test.htm to test.php as well :) That should hopefully sort it out :)

Welshy
08-01-2007, 13:46
I thought you meant you'd looked at Counter Strike: Source code :embarassed:

Admiral Huddy
08-01-2007, 13:47
Cheers mark and Davey, will upload the suggested tests tonight!

Sorry for noobness.

Welsy - Report to my cabin for a spanking! :D

Davey_Pitch
08-01-2007, 13:49
No probs mate. Hopefully one or the other will work. My PHP knowledge is all theory at the moment, not had time to put it into practise yet (despite installing a PHP enabled Apache server on my own machine :/), so I may be a bit off.

Mark
08-01-2007, 13:51
SSI is still more efficient than PHP, but as it's not a high traffic site, it'll make precisely no difference whatsoever, so either option works. :)

Davey_Pitch
08-01-2007, 14:11
More efficient in what way? Sever load?

Mark
08-01-2007, 15:14
Yup, I believe so. PHP is a whole language with lots of overheads. SSI is pretty simple (and built into the web server).

It used to be the case many years ago that SSI performance sucked, but I've been reassured that isn't the case now.

Admiral Huddy
08-01-2007, 16:04
Mark, the line of code I quoted above, is that correct because it comes out as a comment line?

ps - stop changing your name - you know I'm easily confussed :p

Davey_Pitch
08-01-2007, 16:17
At a guess I'd remove the

<!--

and

-->

:)

Mark
08-01-2007, 16:17
New name is temporary until I can think up a new moniker. I'm tired of all the old ones. Too much baggage in one case, too long in another, and the others were only for the holidays anyway. :)

And yes, as far as I can tell, the code you used was correct, and (for Davey's benefit), that's including the <!-- and -->. :)

kaiowas
08-01-2007, 17:42
The SSI is handled by the server and the line of code replaced with the file to be included before the browser interprets the HTML. As a result the fact that it shares the same syntax as an HTML comment is irrelvant. It's probably done that way so that if the SSI fails for any reason and the include instruction is passed to the browser it'll then see that as a comment and ignore it.

Welshy
08-01-2007, 17:55
Welsy - Report to my cabin for a spanking! :D
oo eer sailer! ;)

Mark
08-01-2007, 18:15
No, in other words, the comment tags are required. :)

SSI won't work without them.

Davey_Pitch
08-01-2007, 18:16
No, in other words, the comment tags are required. :)

SSI won't work without them.
Aye, I realised that and deleted my post.

Admiral Huddy
12-01-2007, 10:52
Yay - it works

http://www.admiralcomputers.co.uk/test2.shtml

I've noticed, quite obviously thinking about it, that the "include" actually copies in the code from the html code rather than calls it as a seperate procedure.

I can now make a quick fix to the other pages without the hassle of dupilcating all that damn code.

EDIT - Does any one know how I can make the table semi-tranparent?

kaiowas
12-01-2007, 15:02
I seem to recall that IE can't deal with transparency properly so it's generally best not to bother.