hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Web Design and Content : Inserting html page in other html page & shared border problem
Reply

Web Design and Content Subjects include, HTML, graphics, editors, CSS, Flash, graphics creation, placing of ads, ad serv companies, copyright, content and nearly anything else design related. Also talk about businesses that provide design services. If you link to your site, you must post in Web Site Reviews.
Forum Jump

Inserting html page in other html page & shared border problem

Reply Post New Thread In Web Design and Content Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 07-15-2009, 02:04 AM
globalcashsite globalcashsite is offline
WHT Addict
 
Join Date: May 2009
Location: Kuwait
Posts: 109

Inserting html page in other html page & shared border problem


Guys

On my website <<snipped>> I have left side menu that is created in each page. I know that is not a good way to do because I have to make changes on all pages.

I want to create left menu in a html page and then wish to add that page in all pages so I may change at one place and that reflects on all pages.

How to insert html page in another html page? Any code or what?

I did not use Shared Border of leftside (as top or bottom) because Shared Border keeps out of page. My page width is 960px but shared border goes extreme left. If I can solve this problem then I don't need to create separate menu page and then insert in all pages? Any solution of this?

GCS

__________________
best investment sites


Last edited by anon-e-mouse; 08-30-2009 at 08:35 PM.
Reply With Quote


Sponsored Links
  #2  
Old 07-15-2009, 02:20 AM
tim2718281 tim2718281 is offline
Web Hosting Master
 
Join Date: Mar 2009
Posts: 2,218
Quote:
Originally Posted by globalcashsite View Post

How to insert html page in another html page? Any code or what?


GCS
Thay's exactly what html frames are for.

For a tutorial on using frames, see http://www.w3schools.com/HTML/html_frames.asp

Reply With Quote
  #3  
Old 07-15-2009, 02:25 AM
globalcashsite globalcashsite is offline
WHT Addict
 
Join Date: May 2009
Location: Kuwait
Posts: 109
Quote:
Originally Posted by tim2718281 View Post
Thay's exactly what frames are for.
Thank you for your reply.

Visit my other site <<snipped>> move a little down and see books menu.

I have used frame in that site but I don't feel comfortable with frames because when I tried to extend/enlarge my menu I have to open each page and set width of each frame manually? If there is solution of this problem then frame will be good for my situation.

Right now I have only few items in left menu at globalcashsite.com but I have plan to add one topic after each 2-3 days and that will go to 20-25 items. So in frame option that will be hard to open all pages and then set size.

GCS

__________________
best investment sites


Last edited by anon-e-mouse; 08-30-2009 at 08:36 PM.
Reply With Quote
Sponsored Links
  #4  
Old 07-15-2009, 09:46 AM
tim2718281 tim2718281 is offline
Web Hosting Master
 
Join Date: Mar 2009
Posts: 2,218
Quote:
Originally Posted by globalcashsite View Post
I have used frame in that site but I don't feel comfortable with frames because when I tried to extend/enlarge my menu I have to open each page and set width of each frame manually? If there is solution of this problem then frame will be good for my situation.
Can you use server-side includes?

See http://httpd.apache.org/docs/1.3/howto/ssi.html for server-side includes in Apache.

Reply With Quote
  #5  
Old 07-15-2009, 09:56 AM
cartikadave cartikadave is offline
Web Hosting Evangelist
 
Join Date: Mar 2005
Location: USA
Posts: 517
Quote:
Originally Posted by tim2718281 View Post
Can you use server-side includes?

See http://httpd.apache.org/docs/1.3/howto/ssi.html for server-side includes in Apache.
Yes, I almost always parse .htm/.html pages as SSI if not using PHP. This allows you to created navigation, headers, footers etcetera as seperate pages and simply use something like <!--#include virtual="/leftnav.html" --> which in this case inserts the left navigation file where you want it to show up. If you update the file "leftnav.html" and upload it, the changes will show across all pages using the include.

To parse .htm/.html extensions in cPanel, look for Apache Handlers and add the extensions, in H-Sphere go to web options for the domain in question and turn on SSI, then add the extensions, then "apply settings".

Reply With Quote
  #6  
Old 07-15-2009, 10:18 AM
globalcashsite globalcashsite is offline
WHT Addict
 
Join Date: May 2009
Location: Kuwait
Posts: 109
Guys

I also got problem with iframes as every page was opening inside iframes and I also read that some browsers don't support iframes. So iframe will not be a good option.

In above SSI examples can you please guide me how I can insert page. For example my sidebar menu page name is "leftmenu.htm" and my index file name is "index.htm"

After opening index.htm in frontpage how I can insert "leftmenu.htm" in this (and later all files)?

Please guide me?

Thank you


GCS

__________________
best investment sites

Reply With Quote
  #7  
Old 07-15-2009, 11:10 AM
cartikadave cartikadave is offline
Web Hosting Evangelist
 
Join Date: Mar 2005
Location: USA
Posts: 517
I pretty much explained above and this is assuming you are hosting on Linux and not a Windows server.

1. you need to set your server to parse .htm and .html extensions as mentioned above

2. you then open up your page using Frontpage and switch to code view.

3. Insert <!--#include virtual="/leftmenu.htm" --> while in code view where you want the file to show up.

4. Make sure the file leftmenu.htm has only the navigation code in it...no document declaration, head,body, or other tags/html.

5. Upload both index.htm and leftmenu.htm to the root of your domain.

The "include" file will only show up on the web server... meaning don't try to "Preview" the index.htm file locally and expect the "include" leftmenu.htm to show up.

If you cannot parse .htm and .html extensions through apache handlers in your hosting control panel you will have to use the .htaccess method. There are many references on the web if you search for .htaccess parse .htm files as SSI


Last edited by cartikadave; 07-15-2009 at 11:14 AM. Reason: typo
Reply With Quote
  #8  
Old 07-15-2009, 12:37 PM
globalcashsite globalcashsite is offline
WHT Addict
 
Join Date: May 2009
Location: Kuwait
Posts: 109
Quote:
Originally Posted by tcstatic View Post
I pretty much explained above and this is assuming you are hosting on Linux and not a Windows server.

1. you need to set your server to parse .htm and .html extensions as mentioned above

2. you then open up your page using Frontpage and switch to code view.

3. Insert <!--#include virtual="/leftmenu.htm" --> while in code view where you want the file to show up.

4. Make sure the file leftmenu.htm has only the navigation code in it...no document declaration, head,body, or other tags/html.

5. Upload both index.htm and leftmenu.htm to the root of your domain.

The "include" file will only show up on the web server... meaning don't try to "Preview" the index.htm file locally and expect the "include" leftmenu.htm to show up.

If you cannot parse .htm and .html extensions through apache handlers in your hosting control panel you will have to use the .htaccess method. There are many references on the web if you search for .htaccess parse .htm files as SSI
Hi buddy

Thank you very much

Your post helped me a lot. I used your tip <!--#include virtual="/leftmenu.htm" -->other things I was already doing but with other wrong include command. You told me correct command and this worked.

Regards


GCS

__________________
best investment sites

Reply With Quote
  #9  
Old 07-15-2009, 12:55 PM
cartikadave cartikadave is offline
Web Hosting Evangelist
 
Join Date: Mar 2005
Location: USA
Posts: 517
You're welcome and glad to help.

Reply With Quote
  #10  
Old 07-15-2009, 01:51 PM
liam_tmt7 liam_tmt7 is offline
Web Hosting Guru
 
Join Date: Jun 2003
Location: Scotland
Posts: 298
interesting topic.

Im glad SSI's were mentioned after the frames comment as well, I dont think ive seen a frames site this year.

Reply With Quote
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
possible to output a rendered javascript page into an html page without the js ? jjk2 Programming Discussion 17 05-15-2009 09:09 PM
How do I wrap a web page into a html page? LayerSolutions Programming Discussion 12 01-26-2006 08:56 PM
Apache feature /page => /page.html GoranTornqvist Hosting Security and Technology 2 10-14-2005 12:33 PM
How to make HTML visible on HTML page seodevhead Web Design and Content 3 09-25-2005 11:44 PM
Inserting SWF file into HTML page Mikey007 Web Design and Content 8 05-17-2005 02:01 PM

Related posts from TheWhir.com
Title Type Date Posted
Web Hosting Sales and Promos Roundup – Friday, November 23, 2012 Web Hosting News 2012-11-23 17:32:22
Web Host MTL Servers Launches Shared Cloud Hosting, Cloud Servers Web Hosting News 2012-07-12 14:39:19
Major DreamHost Outage Hits VPS, Dedicated Hosting Customers Web Hosting News 2012-01-30 10:57:44
Shared Hosting Provider Funio Completes Separation from iWeb Brand Web Hosting News 2012-01-16 16:50:48
Host Color Offers Free CDN with Shared Web Hosting Web Hosting News 2011-12-19 16:30:09


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?