SitePoint Sponsor

User Tag List

Results 1 to 19 of 19
  1. #1
    SitePoint Member CWolf2's Avatar
    Join Date
    Jun 2003
    Location
    USA
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Easier site updates

    Hello, I'm new here and I have a question. I have my own site, and I really would like to have it so that I dont need to update 20+ pages when I mod something in the menu. I don't want frames, they aren't my thing, although I can make them, I jsut don't like them. So, is there some EASY way I can have it so that when I update my /index.html menu the rest do? I was thinking about a .CSS thing, but that would get tricky for me, and I'm not sure how that would work. My site is on an Angelfire site because I'm only 14, but can anyone help me? Thanks.
    Last edited by redux; Jun 25, 2003 at 18:00.

  2. #2
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    If you have Dreamweaver, make a template file (.dwt). When you make a change to the menu in the template file, those changes will propogate through the rest of the pages in your site. Other than that, if your host allows it, you can use server-side includes or php includes.

  3. #3
    SitePoint Member CWolf2's Avatar
    Join Date
    Jun 2003
    Location
    USA
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, thanks, but I don't have Dreamweaver. Angelfire is an HTML server, I write in pure code. I really wanted a script to fix this delema, but I guess I'll have to go without it unless someone has any other ideas that will work with just code, and maybe a few more files in the directory. Thanks though vgarcia.

  4. #4
    SitePoint Enthusiast Br00klynzzFinEST's Avatar
    Join Date
    Apr 2003
    Location
    Brooklyn
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    whoa... angelfire ? I dunno... Id look at new hosting

  5. #5
    SitePoint Wizard
    Join Date
    Mar 2002
    Location
    Bristol, UK
    Posts
    2,240
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The only alternative I can think of is to stick it all in a JavaScript file and call that on each page, e.g.

    HTML Code:
    <script language="javascript" src="myscript.js"></script>
    However a couple of obvious disadvantages, you'll have to put all your existing code into javascript format (albeit not as difficult as it sounds, trust me) and of course those who have javascript turned off in their browsers.

    -Sam
    Sam Hastings

  6. #6
    SitePoint Member CWolf2's Avatar
    Join Date
    Jun 2003
    Location
    USA
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well, I have Angelfire, and I dont know of any other one that's A)free, B)easy to use, and C)has a lot of usefull features. I like the sub-directories, but I'm sure that many other places have that, its just that I need a place to be. Also, I just got a new forum, and now I need to update about 13 pages, just to fix one thing, this is why is so annoying.

    To Devilware.net-> I don't know much Javascript, so I wouldnt know how to do that. I mean something thats kinda close to HTML code, but can still get the job done. Sorry, I'm making it hard on everyone, but is there something that I can do this with? Anything that is easy to use for a beginner programmer? I only know HTML and a bit of PHP. Thanks.
    -= CWolf2 -::- The Populace =-
    Links -My site -::- My forums -::- My Blog
    "the purpose of war is not to die for your country, but to
    make the other guy die for his." -Dwight D. Eisenhower

  7. #7
    Shiny Content! Pandrogas's Avatar
    Join Date
    Feb 2002
    Location
    Bozeman, MT
    Posts
    151
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Unfortunatly, I don't know how well Angelfire
    tolerates PHP pages. If it did, then you can just
    do includes to call the navigation.

    The only other way would be to use CSS or Javascript.
    Sorry. I wish I could think of something, but it's
    limited because of Angelfire.
    Matthew Gowdy---AKA---Pandrogas
    SeerNET: Various Geekery All Around

    Contact Information: E-Mail - AIM: Pandrogas

  8. #8
    gingham dress, army boots... silver trophy redux's Avatar
    Join Date
    Apr 2002
    Location
    Salford / Manchester / UK
    Posts
    4,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    changed the tile of the thread to something a little more descriptive...
    re∑dux (adj.): brought back; returned. used postpositively
    [latin : re-, re- + dux, leader; see duke.]
    WaSP Accessibility Task Force Member
    splintered.co.uk | photographia.co.uk | redux.deviantart.com

  9. #9
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Lancaster, PA
    Posts
    3,019
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Ummm...what about using Server Side Includes? That would be about the easiest way I think to maintain a common menu/navigation system if Angelfire allows it.

    Steve
    Web Designer or Small Business Owner?
    Need More Leads and More Clients?
    Get Free Marketing Tips, Tricks and Ideas Here!

  10. #10
    SitePoint Member CWolf2's Avatar
    Join Date
    Jun 2003
    Location
    USA
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oo, thats a good idea Ravendesigns. But how would I do that? Well here, let me make it easier on all of you. Does anyone know of a free, easy-to-use web server that can support something that would be able to help me? If so, please tell me about it, I am willing to change.
    -= CWolf2 -::- The Populace =-
    Links -My site -::- My forums -::- My Blog
    "the purpose of war is not to die for your country, but to
    make the other guy die for his." -Dwight D. Eisenhower

  11. #11
    SitePoint Wizard
    Join Date
    Mar 2002
    Location
    Bristol, UK
    Posts
    2,240
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    To be honest, using a JavaScript file isn't difficult. All you would really need to do is use document.write in order to print text/images etc to the page, i.e.

    Code:
    document.write('Hello World!');
    document.write('<img src="helloworld.gif" />');
    is all that is required.

    As for free webhosting that support PHP, you'll have a job finding a reliable one, but there are a few. The first one that springs to mind is CoolFreePages but I can't really give an opinion as I have little experience with it.

    -Sam
    Sam Hastings

  12. #12
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Lancaster, PA
    Posts
    3,019
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by CWolf2
    Oo, thats a good idea Ravendesigns. But how would I do that? Well here, let me make it easier on all of you. Does anyone know of a free, easy-to-use web server that can support something that would be able to help me? If so, please tell me about it, I am willing to change.
    Hey Cwolf2,

    I'm not sure about any free hosts that would let you take advantage of SSI's, but if you do find one, here's an article that helped me to get a handle on them a few years ago. Hope this helps

    DEMYSTIFYING SSIs
    by Troy McKenna
    http://www.webprogroup.com/
    SSIs.......
    You've heard about them. Maybe youíve even read about them, but you're still confused by them. Well, don't be! This monthís Troy's Toolbox is designed to teach you the basics of SSIs and how you can benefit from their use. If you're looking for an in depth technical discussion, look someplace else. But if you're looking for the "Learn How To Use SSIs in 5 Minutes or Less" version, this article is for you!
    Why would you even want to learn about SSIs and how to use them? To begin with, SSIs are very useful for adding dynamic content to your static HTML pages.
    But what can you do with them?
    (1) You can include the same headers and footers automatically on every page of your web site--a real time-saver for making edits across your entire web site!
    (2) You can have document information, like last modified dates, automatically displayed in your pages.
    (3) You can embed cgi scripts that will run automatically and print the output to your web page. An example of this would be a rotating script which shows a new quote, joke, image etc., each time the page is visited.
    So what are SSIs? "SSI" is an acronym that spells out to "Server Side Includes." So just what does this mean?
    When your browser sends out a request for a web page to a remote server, the server can be configured to check the requested file and see if it is supposed to include additional information before it sends you the final document. What does the server look for? It looks for SSI tags embedded in the HTML of the web page.
    Okay. You now know what SSI means and a little about how it works, but letís delve deeper to find out exactly what YOU can do with it and exactly how you can make the SSI do what you want.
    First of all, you need to find out if you can use SSIs on your server. If you don't know, contact your server admin or support to find out. Also, ask them if you need to give your web pages with SSIs a special extension. You may need to give web pages with SSIs a ".shtml" or ".shtm" extension, or you may be able to just give them the normal ".htm" or ".html" extension, depending on the configuration of your server.
    Now, what is an SSI tag? This is basically just a modified comment tag. It consists of three basic parts (okay, five if you want to get technical):
    1. A comment tag opening with an added pound (#) sign: <!--#
    2. An element or command that tells the server what to do
    3. An attribute option that tells the server the attribute or option for the command
    4. A value that tells the server what to perform the command on (I.E. a file name)
    5. A comment tag terminator: -->
    Now letís put them all together using the "include" command:
    <!--#include file="footer.html" -->
    This tells the server to include the file name "footer.html" in the requested HTML document. Notice the space between the value, "footer.html" and the terminator "-->." That space MUST be included.
    Next, letís get off to a quick start by taking a look at the two most commonly used commands, at their attributes, and at some usage examples.
    1. INCLUDE: As the name and the example above suggest, this command tells the server to include another file in the current HTML document. This can be used to insert headers and footers, or other text that you want displayed on your web page. This command can also be used to call cgi scripts from within your document, and the output can be displayed on the web page.
    The attributes or options: "file" or "virtual"
    Usages:
    Include a header in a document: <!--#include file="/headers/header1.txt" -->
    Embed a cgi file in a document: <!--#include virtual="rotate_quotes.cgi" -->
    2. FLASTMOD: This command will display the last modified date of a file.
    The attributes or options: Same as for the "include" command
    Usages:
    Show the last modified date of a file that you've linked to: <A HREF="page2.html">Next Page</A> - Last Modified: <!--#flastmod file="page2.html" -->
    Same thing as above, using the "virtual" attribute: <A HREF="../page2.html">Next Page</A> - Last Modified: <!--#flastmod virtual="../page2.html" -->
    By now you should have a good working understanding of what SSIs are, how to get started using them, and--most importantly--how they can make your life easier!
    Have fun!
    Troy McKenna troy@lrsmarketing.com
    Web Designer or Small Business Owner?
    Need More Leads and More Clients?
    Get Free Marketing Tips, Tricks and Ideas Here!

  13. #13
    SitePoint Member CWolf2's Avatar
    Join Date
    Jun 2003
    Location
    USA
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Okay, thanks a lot man. Oh, and my computer isn't that good, so I can't host my own site like I would have to with the coolfreepages.com thing, but I will hopefully get a new PC very soon, so I might be able to, but just the same, I would rather like not to. Now, abotu the SSI thing, it's just a simple thing almost like inserting frames and images at the same time right? cool, but heres the thing, I would like a frame, but locked with the rest of the page, so it acts normal scrolling up/down. I really do need to have this thing, it is a vital thing, the site will almost rest upon it, so I need it like I said. But I will try to look up this SSI things. But just one more question, it said it could insert headers and footers or ust plain text, so how would I make it insert a side menu? I would also need a top bar because I would kinda need to keep that updated as well. But anyways, if anyone wants the site, its in my sig, or better yet, its at http://www.angelfire.com/vt2/cw2 thanks.
    -= CWolf2 -::- The Populace =-
    Links -My site -::- My forums -::- My Blog
    "the purpose of war is not to die for your country, but to
    make the other guy die for his." -Dwight D. Eisenhower

  14. #14
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Lancaster, PA
    Posts
    3,019
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Take a look at both sites in my sig - they use ssi's for top, left and bottom navigation and I wouldn't design a site without using them cause they save so much time when you need to update a header or navigation menu. If you look at the source code you can't tell where they're included (one of these days I'll start commenting my code!) but it's just the simple SSI that includes the links, images or whatever I need. I'll see if I can throw together a couple of example html files for you to look at when I get home tonight.
    Web Designer or Small Business Owner?
    Need More Leads and More Clients?
    Get Free Marketing Tips, Tricks and Ideas Here!

  15. #15
    SitePoint Member CWolf2's Avatar
    Join Date
    Jun 2003
    Location
    USA
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Okay thanks. Oh, and I got a site at the Tripod.co.uk, so I can use SSI, and PHP on it, but for now I'm just going to be using FrontPage to make the things I want. If anyone can help me by telling me what I need to code for the SSI, I would appreciate that. But that essay you posted did help a bit RaveDesigns, thanks. But now I was wondering, where would I put the code? would it just be like

    Code:
    <!--#include file="/menu/menu1.txt" -->
    Page coding
    <!--#flastmod file="page2.html" -->
    this? I don't really understand it, but again, I'll try to find things on Google, but I might need help.
    -= CWolf2 -::- The Populace =-
    Links -My site -::- My forums -::- My Blog
    "the purpose of war is not to die for your country, but to
    make the other guy die for his." -Dwight D. Eisenhower

  16. #16
    SitePoint Addict hurricane.uk's Avatar
    Join Date
    May 2003
    Location
    Liverpool
    Posts
    361
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi CWolf2

    If Tripod allows php then I'd suggest that you chose PHP includes over SSI, as this would give you greater scope for developing your site as you gain experience.

    To use a php include you would insert this at the point in your code where you would insert the menu: <?php include(menu.txt) ?> for example, you'd change menu.txt to point to whichever file you wanted including at that point. Within menu.txt you would include the code for your menu, including the relevant tags. The server will then collect that information and import it into your page and display it as regular html along with the rest of the page content. If using PHP includes you need to remember to use the .php file extension in place of .html (if using SSI you would need to use the .shtml extension on apache servers, and the .stm if on a windows server that supports SSI (NT4 servers)).

    I hope that helps.

  17. #17
    SitePoint Member CWolf2's Avatar
    Join Date
    Jun 2003
    Location
    USA
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Tripod does allow both PHP and SSI lucky for me. I have been using MS FrontPage just for fun and it's working out quite nicely. But where would I put the menu.txt file, in the main directory? I have had a form type thing before and thats where the .txt file was, but where would I put this one? Also, instead of all the code for the menu like the links and stuff, I would just include this little text and it would work? If so, then great, this is what I have been looking for, but RaveDesigns has offered to help me already, so if SSI is easier to set up and update, I might go with that. Might as well get what I signed up for in Tripod (using both scripting choices that is). So how would I put this, give me a short code for example, would it be like...
    Code:
    <html>
    <body bgcolor="white">
    <table>
         <tr>
             <td><?php include(menu.txt) ?></td>
         </tr>
         <tr>
             <td>Main Page code.</td>
         </tr>
    </table>
    </body>
    </html>
    Of course it would be scripted in PHP but Im so used to HTML that I just wrote it like that. But would that be the basics of it? Or would it be much different?
    -= CWolf2 -::- The Populace =-
    Links -My site -::- My forums -::- My Blog
    "the purpose of war is not to die for your country, but to
    make the other guy die for his." -Dwight D. Eisenhower

  18. #18
    SitePoint Addict hurricane.uk's Avatar
    Join Date
    May 2003
    Location
    Liverpool
    Posts
    361
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by CWolf2
    So how would I put this, give me a short code for example, would it be like...
    Code:
    <html>
    <body bgcolor="white">
    <table>
         <tr>
             <td><?php include(menu.txt) ?></td>
         </tr>
         <tr>
             <td>Main Page code.</td>
         </tr>
    </table>
    </body>
    </html>
    That would be fine. Or you could go further with using the includes for other sections of the page, I know people who use a CSS layout skeleton and fill in the gaps with includes that grab the individual parts from other files. It makes it easier to update. Sticking with a tabular example for now, though while you're on a learning kick it might be a good time to work on CSS.


    Code:
    <html>
    <head>
      <title> ... </title>
    <body>
    <table>
         <tr>
             <th colspan=2><?php include(header.txt) ?></th>
         </tr>
         <tr>
             <td><?php include(menu.txt) ?></td>
             <td><?php include(body.txt) ?></td>
         </tr>
         <tr>
             <td colspan=2><?php include(footer.txt) ?></td>
         </tr>
    </table>
    </body>
    </html>
    You then have a basic layout that you can use for each page, keep the content, along with any necessary tags such as line breaks, in individual files that you call with the includes. If you ever need to change the content you just replace the text in the relevant file, and as it isn't overrun with html code (which would happen with a tabular design) it becomes that much easier to edit/replace on individual pages. The benefit is greater still with site-wide content such as your header, footer and menu, as you only need to modify the content of the one file and the change will be propagated through to every page in the site that uses an include pointing to that file. If you then use CSS to define the styles, rather than within your html tags you can make everything easier still.

  19. #19
    SitePoint Member CWolf2's Avatar
    Join Date
    Jun 2003
    Location
    USA
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow, thanks, this is just waht I needed. This should work great, but here's the thing, I am going to have a bunch of pages, so I'll need to have the main page text in there, so I would just switch the ?php insert('body.txt') thing with the stuff right? Wel, now I'm actin glike I'm new to this, of course I would and I would just have the .txt files in the main directory. Well, thanks for the help, I'll update everyone here if it works.
    -= CWolf2 -::- The Populace =-
    Links -My site -::- My forums -::- My Blog
    "the purpose of war is not to die for your country, but to
    make the other guy die for his." -Dwight D. Eisenhower


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
  •