-3

So I am editing code for a job- the files are old html css and shtml files. So all the html files have matching shtml files. When I download the files and put in my sublime text editor the outcome looks different then the real thing. And when I load them to a test site they look even more different. What is going on I am very confused.

this is the original site

When I load them in sublime the navigation on the left side is not there at all. but works the same.

this is the test site I loaded the site to

anyone have any idea on what is really going on with this? Its a basic cpanel too.

Sparky
  • 98,165
  • 25
  • 199
  • 285
sara
  • 1
  • 4
  • I got news for you... the markup on the two sites is **not** the same, hence the main reason they display differently. I can't explain why because I cannot see what you've done to cause this. – Sparky Jul 25 '16 at 20:07
  • I didnt do anything - All I did was copy the files from filezilla and I loaded them on the test site and it does it any ideas on how to fix this? – sara Jul 25 '16 at 20:10
  • I can't explain how *moving* files to another server causes them to re-write themselves. Maybe try again, but this time, do **not** load them into a text editor. – Sparky Jul 25 '16 at 20:12
  • *"So all the html files have matching shtml files."* ~ what does "matching" mean? Typically, you wouldn't have need two versions of each file. – Sparky Jul 25 '16 at 20:18
  • I did what you said with the files trasnfered them and just loaded to the test site and does the same. matching means spring-summer-flags-pg7.html spring-summer-flags.shmtl both same code in both files... its odd I did not make this site I have no idea why they did it like this. And the code is even odder inside – sara Jul 25 '16 at 20:23
  • @sara, see my answer below. It might explain the behavior you are seeing. – larrylampco Jul 25 '16 at 20:24
  • Thanks @larylampco - I read that but how can I edit this and load it so it looks correct ? – sara Jul 25 '16 at 20:28
  • @sparky any idea on how I can fix this with out re coding the whole site? Can I just edit the html and take out what is messing up/connecting to the shtml files ? or is that no good? – sara Jul 25 '16 at 20:32
  • If you have two files containing the same code, then you've inherited some really sloppy practices. It's likely that one of the two files was just leftover from some previous development and never deleted. If you don't have the skills to decipher this, then it might be easier to start over from scratch. We cannot see enough to do it for you. – Sparky Jul 25 '16 at 20:34
  • Once you thoroughly understand SHTML parsing and SSI, you will probably know enough to figure out how to untangle and fix it. Pay more attention to @larrylampco – Sparky Jul 25 '16 at 20:36
  • @Sparky thank you I will- Again I did not create this site so am trying to figure out what they did. Thank you for your help ! You are awesome! – sara Jul 25 '16 at 20:39
  • If you take *all* of larry's advice and remove the SSI, you will quickly learn how tedious maintaining the site will become. With SSI, you simply edit the ONE menu file and the menu will render the same across all pages. If you remove the SSI, then one simple change to the menu will involve editing *every single page* on the site. – Sparky Jul 25 '16 at 20:44

2 Answers2

0

You have the div <class="sidebanner-frontpage"> nested within <div class="container-content-sidebar"> in one site, but not in the other. This is changing its layout.

M -
  • 26,908
  • 11
  • 49
  • 81
  • I removed it and it still does it. I even tryed to copy the code for the nav and place into the index.html file just to see if I can get it to show when loaded and nothing. Puts it in and I can see it when I do it on my end on sublime text editor but as soon as I load it to the test site goes all crazy. – sara Jul 25 '16 at 20:14
0

Your web server is giving precedence to the ".html" pages. The ".html" pages have server side includes in them and they are not being rendered. You should take the ".html" pages out or include the sections manually that are included using SSI.

See this SO article for more information on shtml: What is shtml

Community
  • 1
  • 1
larrylampco
  • 597
  • 1
  • 9
  • 33
  • But I tryed to upload just the html files to the test site... and it still does that. What can I do to fix this without coding the site again? – sara Jul 25 '16 at 20:25
  • This answer does not explain the issue just 15 minutes ago when all SSI parsing was working fine. – Sparky Jul 25 '16 at 20:26
  • @sparky, if all SSI includes were working fine, then we wouldn't see any in the html right? – larrylampco Jul 25 '16 at 20:28
  • 15 minutes ago, I brought them up side-by-side and the ***only*** visual difference was the menu on the right instead of the left. I saw no un-rendered SSI tags in the code. The HTML structure was also completely different between the two... broken SSI does not explain that. – Sparky Jul 25 '16 at 20:29
  • @sara, uploading just the html files will not fix your problem either because the SSI includes are still in the html files. – larrylampco Jul 25 '16 at 20:29
  • @larrylampco can I remove the SSI from the html files and load it that way? and what are they inside the html (sorry if I am slow at this ) – sara Jul 25 '16 at 20:31
  • It looks like "http://mcswebtest.com/test9/" is defaulting to the "index.html" file. If you go to "http://mcswebtest.com/test9/index.shtml" it looks like everything is working fine. – larrylampco Jul 25 '16 at 20:33
  • wow it is... so should i try to get rid of the html files and try just the shmtl files and see if that works? – sara Jul 25 '16 at 20:37
  • @sara, the `.htaccess` file is typically used to set the default page in order of precidence... `index.cgi, index.php, index.html, index.shtml`... you can either edit this or remove all versions of `index` except for the one you need. – Sparky Jul 25 '16 at 20:39
  • @sara, yes, or add the sections of code that the ".shtml" files are including in the ".html" files. – larrylampco Jul 25 '16 at 20:39
  • Ok thank you @larrylampco I will give this a shot and try and let you know if it works thank you ! – sara Jul 25 '16 at 20:40
  • @sara, SSI is there for a good reason. While larry has found your root problem, removing SSI is not a great idea... it will just make the site harder to maintain moving forward. Just remove the `index.html` file and instead use the `index.shtml` file since that seems to work already. – Sparky Jul 25 '16 at 20:40
  • Thank you both for your help - I took both your advice and loaded the .shtml files and excluded the index.html file only and it worked all the pages work - I agree this is a bad practice and do not do my sites like this and I thank you for all your help! – sara Jul 25 '16 at 21:11