Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> Big Sites With No Frames, i cant find a way !
Uzumaki-Naruto
post Oct 17 2005, 10:26 AM
Post #1


Newbie [ Level 2 ]
Group Icon

Group: Members
Posts: 27
Joined: 17-October 05
Member No.: 9,155



You see when you want to make a big website with a navigation bar on each page . you have to put the links on every page . And when you want to add a new link you have to add all them to the pages . Now there is a way ... iframes are one way but some web browsers do not support iframes . Is there any other way i could do this ?
Go to the top of the page
 
+Quote Post
szupie
post Oct 17 2005, 12:27 PM
Post #2


S.P.A.M.S.W.A.T.
Group Icon

Group: Members
Posts: 814
Joined: 22-January 05
From: San Antonio, Texas (No, I'm not dumb. I just moved here...)
Member No.: 2,284



You can make a page with just the navigation bar, and include it in all the pages on you site. You can use javascript to do that (I don't know much about javascript, though), or you can use php to do that, which is what I've done. Use include('<you navigation page here>'>) to add the navigation page on your pages. Astahost has php, so you can use it on the site you'll have here.
Go to the top of the page
 
+Quote Post
Hercco
post Oct 17 2005, 12:36 PM
Post #3


Super Member
Group Icon

Group: Members
Posts: 595
Joined: 4-September 04
Member No.: 228



The trick is to do some serverside processing.

Let me explain. Instead of manually editing every page (html file) and adding the menu, you make a separate file containing the html code for the menu and include it to each of your pages.

The including is done with some server side technique. In practice you use either Server Side Includes (SSI) or some serverside scripting language (ASP, PHP, JSP).

In SSI you include the files like this

CODE
<!--#include virtual="relative/path/to/file.ext" -->


In order SSI to work the server must support it and the file extension must be corrent. Usually it is .shtml but is configurable so can be anything. It can be configured to .html or .htm so you don't even need to change the extension. And I mean the extension for the file in which that #include call resides.

SSI is quite old method and is probably less likely to be installed on a server than PHP for example. So I'd recommend you to go with PHP as it does the trick just as easy (even faster).

In php you include file with this kind of call

CODE


<?php include('path/to/file.ext');?>



<?php marks the beginning of PHP code (so that the parser can find it) and ?> the end. The path to the file can be either relative or absolute.

Instead of include() you could use function require(). Require requires the the file is found and can be included. If the file is not found the script will terminate and error message is displayed. the syntax for the call is exactly the same. I've heard that some webhosts have disabled include (for some reason) so you have to use require. Anyways it works just the same.

In order to your PHP code get processed the files must be named with the extension .php. (index.php) for example)
Go to the top of the page
 
+Quote Post
minnieadkins
post Oct 17 2005, 04:25 PM
Post #4


Premium Member
Group Icon

Group: Members
Posts: 292
Joined: 15-December 04
Member No.: 1,768



So basically you have a file called "navigation.php" then you have your index.php, page1.php, page2.php. If your pages (page1, page2) are dynamic then you just add the include statement to generate your menu while you generate it. Butif you manually code it, you put in the include("./filetoinclude") statement?

I've seen a lot of pages with menus that only load like the right hand side of the screen. As to give you an illusion that the menu is static, while it only loads the content needed. Is this just an illusion, or is that actually what happens? I'm kinda curious on this as well.
Go to the top of the page
 
+Quote Post
evought
post Oct 17 2005, 04:54 PM
Post #5


Advanced Member
Group Icon

Group: Members
Posts: 199
Joined: 3-October 05
Member No.: 8,888



QUOTE(Uzumaki-Naruto @ Oct 17 2005, 05:26 AM)
You see when you want to make a big website with a navigation bar on each page . you have to put the links on every page . And when you want to add a new link you have to add all them to the pages . Now there is a way ... iframes are one way but some web browsers do not support iframes . Is there any other way i could do this ?
*



Besides the PHP and Javascript routes, there is the XML stylesheet route:

Generate your site content in an XML dialect (e.g. docbook) and use a stylesheet to generate the X/HTML and provide the CSS. Then, the navbar, footer, header, *is* actually embedded in each (HTML) page, but not in your original source (the XML) and the stylesheet keeps everything up to date.

----

The downside to all of these is problems with caching of documents. With the PHP or Javascript route, the last-modified date usually ends up being the modified time of the main page. If the navbar is newer, the client may not reload it. With the XML route, every time you update the navbar, header, footer, etc, all pages get marked as new and no caching happens.

With frames or the Object tag, the browser can reload only the pieces which are actually out of date and performance is generally much better. As you have noted, however, some browsers are still squirrelly with the Object tag or with iFrames. It is possible using PHP to look at the browser and use either an Object tag or a direct include based on the browser type. This ends up with the best possible performance but gets complex. When my site got to the point where this was a pain, I just went to a CMS that handled all of the overhead for me.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. full flash sites(60)
  2. Music Sites(25)
  3. Video Editing Software(23)
  4. How Do I Find A Site's Ip Address?(15)
  5. Online Dating Sites(15)
  6. Persian Sites(2)
  7. The Most Pathetic Web Sites On The Internet Awards(13)
  8. Free Photo Storage Sites.(10)
  9. Tennis Sites(4)
  10. Some Of The Best Soccer Sites ( Add More To This )(4)
  11. SiteAdvisor: Search Engines Take Users To Spyware Sites(11)
  12. JavaScript Frames & Querystring(4)
  13. Bypassing Filtered Sites(29)
  14. Juggling An Iframe Box With Xhtml Sites(8)
  15. Centering The Page(6)
  1. Essential Sites For Web Designers(8)
  2. How To Move My Sites (files And Database) To Computing Host(6)
  3. Runescape Phisihing Sites.(0)
  4. I Didn't Know Only English Sites Were Accepted(11)
  5. Please Comment One Of My Sites(3)
  6. All Of Dietzel's Sites In One(0)
  7. Free Mysql Server Sites(9)
  8. Download Sites?(2)
  9. Xhtml, Javascript, Css And Frames.(0)
  10. Can't Access Astahost Hosteed Sites (including Cpanel And Ftp)(21)
  11. Acer Desktop/laptop Drivers Download(0)
  12. Sitepoint's Css And Html Reference Sites(2)
  13. Content Sites And Mini Sites(1)


 



- Lo-Fi Version Time is now: 7th September 2008 - 02:46 AM