SitePoint Sponsor

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 25 of 34
  1. #1
    SitePoint Member
    Join Date
    Jun 2001
    Location
    Bangkok, Thailand
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Can you make changes to only one page and have ALL pages reflect the change?

    I used to be a frames junkie because of the fact that I could add links or take away links from just _ONE_ page and that was that. Now that I've gotten my own domain, I don't want to do frames anymore, but here's the problem: if I want to add another link, I'd then have to manually add it to every single darn page by hand. So 100 pages = 100 changes.

    Is there a way to make changes to only one page and have all the other pages reflect that change? Kind of like a dynamic template--changes made to the template will change every page that uses that template (like the CSS linking in files, only this is meant to incorporate more than just CSS--it is meant to incorporate the entire design and links). I was thinking of the usual links-at-the-left, content-in-a-table-in-the-middle type of design, with the only thing different about any two pages is the content in the table. I really don't want to use frames, but the sheer work involved in adding just one little link is daunting.

    Hope my question was clear. Help please. Thanks.
    Mallika

  2. #2
    Bimbo With A Brain! silver trophy Saz's Avatar
    Join Date
    Mar 2001
    Location
    Kent, United Kingdom
    Posts
    5,275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can use SSI (server side includes) to do this. You'll have to read up on how to do it, as it's something I've not used yet, so I don't know the ins and outs of it, but I think the basics are that you create a page in html for your nav bar/links, then use SSI to call that html file and 'add' it when it displays your other pages. It appears to be a part of every page in your site, where it is, in fact, a separate file.......which you can edit as often as you like.
    Saz: Naturally Blonde, Naturally Dizzy!
    No longer Editor of the Community Crier.

    Don't mind me, I'm having a BLONDE moment!

  3. #3
    Don't get too close, I bite! Nicky's Avatar
    Join Date
    Jul 1999
    Location
    Lancashire, UK
    Posts
    8,277
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    There are two ways:

    You can either have everything in a database and use PHP (but is it quite complicated and you need a host that supports it)
    Or you can use SSI which is what www.nickydanino.com uses. This is a lot easier and if you doa search for it on SItePoint you will find loads of threads pertaining to this topic. (But be aware you still need a host that supports this!)

  4. #4
    SitePoint Enthusiast vSector's Avatar
    Join Date
    Jun 2001
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I reakon you should learn php!!!!

    It makes template style sites easy to build and easy to modify!!!!!

    I use a single header and footer for any websites i build.

    Saves allot of time in the end

  5. #5
    Back in Action Winged Spider's Avatar
    Join Date
    Jun 2001
    Location
    outside my mind
    Posts
    900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If your using Dreamweaver you might want to check into Libr items.

    They don't work that bad actually.

    SSI can mess up with older browsers (I think), and you have to access the server twice which causes a little extra load time.

    I'm going to post another thread to see what people have to say about them. (Library Items)


  6. #6
    SitePoint Member Dogma's Avatar
    Join Date
    Jun 2001
    Location
    United States
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I just discovered ssi and its great. Basically you make a seperate page w/ just some navigation on it for example. Everypage will load it, but you just have to change one file.

    Also, I read somewhere that old browsers that can't understand ssi just ignore it or something like that. Since I'm not sure, look @ this SitePoint Tutorial also, search this forum for ssi. There are some really good threads but I can't find them right now

    Its very easy and nice!!
    my Karma ran over your Dogma err my Dogma ran over your Karma
    CAK design Web and Graphic Design
    WebMafiaForums Admin

  7. #7
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,121
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    SSI is server side. The only reason "old" browsers wouldn't understand would be if they didn't recognize the extension (in this case they wouldn't recognize php either!).

    Anyways, to test if SSI works for you, do this.

    Make a file title.txt, in it put

    "Hi, I'm an SSI indcued title"

    Then open a new document and either call it test.shtml (ssi'd html) or test.asp (ssi is automatically embedded in asp, though the shtml one will more than likely work better since it will work on xNix too). In test.asp put this:

    <html>
    <head>
    <title>
    <!--#include file="title.text"-->
    </title>
    </head>
    <body>
    hi
    </body>
    </html>

    Here's the scoop, SSI is a server side language. Therefore, anytime the page is "called" the file is included. Thus, search engines will search it, and all browsers will receive complete information, IF you server supports SSI (99% do).

    You could then create "template" sites using this. Have a header.txt, a menu.txt, a footer.txt, etc.

    Of course, php or asp are even better for this, but SSI is a good first step.
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  8. #8
    SitePoint Member
    Join Date
    Jun 2001
    Location
    Bangkok, Thailand
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    :)

    Thanks so much! I was thinking there was a coding language or something that does this but I didn't know what it was. Thank you again for pointing me in the right direction!

    By the way, I want to know something ... is SSI easier to learn than PHP or ASP? Would it be better to just start with the "latest" one first?
    Mallika

  9. #9
    SitePoint Member
    Join Date
    Jun 2001
    Location
    Bangkok, Thailand
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    oh and one other thing...

    I heard that SSI eats bandwidth. If this is true, how _much_ bandwidth are we talking about? 10% more?
    Mallika

  10. #10
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,121
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    SSI, the basics, is just what I put for you above.

    It doesn't eat any extra bandwidth as all the "extra" stuff is done on the server. As such, it uses a little extra server power but hardly any at all, less than it takes to process the clicking of the START button in windows.
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  11. #11
    SitePoint Wizard silver trophy TheOriginalH's Avatar
    Join Date
    Aug 2000
    Location
    Thailand
    Posts
    4,811
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    php includes are not really much harder, and you do not need a database to use them. You would need a host that supports php - but that is getting more and more common.
    ~The Artist Latterly Known as Crazy Hamster~
    922ee590a26bd62eb9b33cf2877a00df
    Currently delving into Django, GIT & CentOS

  12. #12
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,121
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Of course you don't need a database... php has nothing to do with databases in and of itself (same as asp), just that they can connect to a database, if the author wishes. There is a tonne you can do with both languages independt of a database... In reality in both languages teh db stuff is just the tip of the iceberg, though a very important tip
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  13. #13
    SitePoint Enthusiast
    Join Date
    Jun 2001
    Location
    Orange, CA
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've used SSI's exclusively for almost four years now. Any new web sites that I develop start off with a template page that I build and include the various static elements as SSI. I normally have a top, bottom, right or left .htm file that is inserted into the tables where they reside.

    SSI's do not hog bandwidth. As a matter of fact, they improve the download time of your site. Once the user has visited a page with an SSI, and then visits another page with the same SSI, it is already in their cache. In some instances, they almost appear to be in frames when you have a site that utilizes the same SSI's on each and every page.

    I utilize FP and the "include page" feature which is the same as SSI. Anytime you create a web site which uses the same look and feel on a majority of the pages, SSI's are a great alternative to scripting languages. The SSI's are also search engine friendly as mentioned above.

  14. #14
    Victory shall be mine tubedogg's Avatar
    Join Date
    Mar 2001
    Location
    Medina, OH
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Personnaly I think that
    <?php include("myfile.html") ?>
    is much easier to remember than
    <!--#include file="file.html"-->
    not to mention that include file only works on files in that directory and virtual="../path/to/file.html" only works on relative paths and cannot cross domains or subdomains. This is the reason I switched to PHP includes from SSI - my site is built on subdomains and I needed an easy way to have a header and footer across it. With php, I just do
    <?php include("http://includes.mysite.com/top.php") ?>
    <?php include("http://includes.mysite.com/bottom.php") ?>
    on every page.
    Kevin

  15. #15
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,121
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Ayup, IF your site supports php. More servers support SSI than php, and the "need" to learn more of php means that for this scenario ssi works

    Not coming down on you though, it is definitely better
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  16. #16
    1-800-JMULDER JMulder's Avatar
    Join Date
    May 2001
    Location
    The Netherlands
    Posts
    1,745
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would really recommend to put as much as possible into a PHP Include. I am using PHP Includes at my own website. eg. I got all of my colors defined in an include, it works similiar to CSS files, but anyway, if I ever want to change my colors I just need to edit that single page and ofcourse the graphics.

    IMO it simply rocks
    Jeroen Mulder

    w: www.jeroenmulder.com

  17. #17
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,121
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hey, I'm not saying it doesn't, just that php in and of itself begs you learn more than just<?php include(); ?> Right? So, for this simple problem, we thought that was the answer.

    We could just as easily have posted a jsp, cfm or asp thing that woulda have done it (or js or cgi for that matter), but simple really is better when all he wants is simple templates.
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  18. #18
    1-800-JMULDER JMulder's Avatar
    Join Date
    May 2001
    Location
    The Netherlands
    Posts
    1,745
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I share your opinion right?
    Jeroen Mulder

    w: www.jeroenmulder.com

  19. #19
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,121
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    hmm... we'll see
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  20. #20
    SitePoint Enthusiast
    Join Date
    Jun 2001
    Location
    Orange, CA
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are the php includes indexible by spiders? Remember that the spider sees what we see when you view the source code of the page through a browser. I ran your site through the spider simulator and it didn't pick up a few things and I'm wondering if those items are coming from the php include.

  21. #21
    Victory shall be mine tubedogg's Avatar
    Join Date
    Mar 2001
    Location
    Medina, OH
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes. If you go to my site ( www.tubescan.com ) and view source on the first page - if you see the HTML for the drop-down menu, you are seeing the PHP include.

    Keep this in mind: if I include something with PHP (or SSI for that matter) it is processed on the server - so if I have a page like this --
    <html><head>
    <?php include('myfile.php') ?>
    content blah blah
    </body></html>
    -- the contents of myfile.php replaces the include line before the page is ever sent the users' browser.
    Kevin

  22. #22
    SitePoint Zealot
    Join Date
    Jun 2001
    Location
    Earth
    Posts
    111
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi everybody.
    I am very interested in the topic discussed here, since I also want to migrate from an existing static site (built using html, a little javascript and edited with FP, but not using frames) to a more dynamic version of it, using PHP (without connecting to a database yet: I am an absolute newbie to php and databases). The site is hosted on a Unix machine running Apache, where SSI is disabled. They still want to use FP for the everyday updating (which would not be done by me, but from somebody else without experience in coding).Incidentally, I use DW.
    The big question is of course: PHP or SSI?
    • security is a very strong concern: how does PHP compare to SSI in this respect?
    • another big point is site maintanability: pageoneresults uses FP in combination with SSI (correct me please if i'm wrong). I know there are problems using php and fp, but , as far as I understood, they can be overcome by the use of ASP tags. In short: I'm concerned for the person which in the end will have to make the daily updates of the site...
    • and, yes, I did also hear that SSI might cause server overhead.

    can any of you help me to come clear with this?
    thnks in advance and ...sorry if all doubts come together like in a big soup.
    cla313

  23. #23
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,121
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    1. Security has nothing to do with your scripting language
    2. Frontpage can't read asp or php, thus the updating of sites via fp while integrating with php or asp is difficult (though someone may have experience with this)
    3. SSI causes no more load than sending an image

    I would like to stress that if you want "dynamic" in terms of centralized resources use centralized CSS, JS and use Frontpage's include page feature (insert>component>include page) as it has the strength of SSI, but frontpage users will be able to understand it. You don't want to hand this site (or whatever) over to these guys, wow them with the features but have them go back to the old version simply because they can't figure out how you did the includes. Make sure it's something anyone can do AND that they know how to do, undo, redo and change what you've done.
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  24. #24
    SitePoint Zealot
    Join Date
    Jun 2001
    Location
    Earth
    Posts
    111
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for the reply. you are absolutely right in your last point concerning maintainability (I forgot to mention I used CSS already).
    concerning security, I badly expressed myself. let's put it this way: is it nor true that enabling on the server a certain scripting language rather than another might lead to a different level of security risk? I mean, by doing that you can expose, if some commands are not carefully handled, confidential info. or not?
    cla313

  25. #25
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,121
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I guess anything is possible, just depends how your network is and how you script... I haven't run into this, but then again I haven't delved into the depths of either language, nor am I a security expert.

    Consider my above comment a "partially informed" opinion
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •