Text file include in HTML documents

Discussion in 'HTML & Website Design' started by aquasonic, Apr 3, 2007.

  1. #1
    Hi,

    This is my first post, and I'm hoping sincerely that someone here can help me.

    I maintain the tech side of things for an amateur arts association website. http://www.w-a-a.org

    I don't edit the website for content, I just provide the base for the editor to put the text on there... and this leads me to my problem.

    Currently I have to give him FTP access in order to go in and update the site... which is fine as I've given him enough HTML knowledge to edit the bits he needs to... but the website is slowly falling out of date, and so I want to give more people access to update the website.

    I'm not technically capable to create an all singing all dancing website where people can log in and update certain areas... and we also don't have enough money in the budget to cover the cost of buying software to do this for us.


    What I want to know is if it's possible to create a text document that will be included in a HTML document and also use the HTML documents font tag to change the style of the text.

    This way I can open an FTP login available to certain members and they can just edit this txt document to change the text on the website - making it easy to understand and also not allowing them to delete sections of code by mistake.


    I was thinking along the lines of having something like this in the HTML...

    which linked to a text file somewhere?

    Any ideas?


    --
    Sonic
    Senior Control Technician

    WARNING:Consumption of alcohol may lead you to believe that ex-lovers
    are really dying for you to phone them at 4 in the morning.
     
    aquasonic, Apr 3, 2007 IP
  2. druidelder

    druidelder Peon

    Messages:
    285
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    0
    #2
    They are called server-side includes and can be used with plain text documents (or you could save them as html). This depends on your web server to be set up to use SSI.

    To check if your server uses SSI, save this code as a .htm (or .html) in the website directory and then view it in your browser. If it displays the name of the day then you are set, otherwise you will need to allow for SSI (the method varies on the webserver software).
    <HTML>
    <TITLE>SSI Test</TITLE>

    <!--#config timefmt="%A" --> <!--#echo var="DATE_LOCAL" -->

    </HTML>


    The code to do this from the website directory is:
    <!--#include file="included.html" -->

    The code to do this from a virtual directory is: (I would reccommend this method so your users don't accidentally delete web files.)
    <!--#include virtual="/directory/included.html" -->
     
    druidelder, Apr 3, 2007 IP
  3. aquasonic

    aquasonic Well-Known Member

    Messages:
    90
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    115
    #3
    I tried it and it didn't work - then I remembered that I already use SSI's in my error pages and they use SHTML - so I changed the extension to .shtml and it worked?!?

    This means that the page will have to be an SHTML page... it's not a problem though.

    You're a star - I thank you. :)
     
    aquasonic, Apr 3, 2007 IP
  4. aquasonic

    aquasonic Well-Known Member

    Messages:
    90
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    115
    #4
    Is it possible to go further from here?

    If I go down this path - I now have a different text file for every single area I want them to be able to change... can I have 1 text document with different SSI's in the same document?

    So they only have 1 text file to edit?
     
    aquasonic, Apr 3, 2007 IP
  5. druidelder

    druidelder Peon

    Messages:
    285
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Unfortunately, not really. A SSI will include the whole file. You could put some variable and some javascript to determine which text to show depending on the page title. However, the users could easily write over that code and break it. You can include the same file on multiple pages though.

    Is this site database driven at all or just html? If it is db driven, you could create a webpage they go to, select the section they need to edit, pull the text from the db and let them save changes to the db.
     
    druidelder, Apr 4, 2007 IP
  6. minute

    minute Peon

    Messages:
    443
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Maybe you can also style the site using css then the guy will only need to change the font in a few places. Maybe save you time or maybe it will give you a bigger headache.
     
    minute, Apr 4, 2007 IP
  7. druidelder

    druidelder Peon

    Messages:
    285
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I think aquasonic wants the guy to change the text not the font tags. The font tag in the original post was to show how aquasonic would place the needed html tags around the included text so aquasonic didn't have 1) teach the new people html, 2) avoid tags getting deleted or written over by not giving the editors access to the html pages.

    aqua, now that I read your first post again, I see that you've already ruled out an update page.
     
    druidelder, Apr 4, 2007 IP
  8. aquasonic

    aquasonic Well-Known Member

    Messages:
    90
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    115
    #8
    Well not ruled out an update page - just not very knowledgeable on how to do it... and time is a constraint.

    Give me a broken circuit board and I should be able to fix it - but give me a website and I'll know the very basics.

    An update page would be the very best option - but this would mean either paying someone to do it - or taking months of my social life trying to get it to work.
     
    aquasonic, Apr 4, 2007 IP
  9. druidelder

    druidelder Peon

    Messages:
    285
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    0
    #9
    What kind of webserver are you on (MS, Apache, etc...)? Does the site already use any db backend? If so, what db is it?
     
    druidelder, Apr 4, 2007 IP
  10. aquasonic

    aquasonic Well-Known Member

    Messages:
    90
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    115
    #10
    Apache... I think?! I'd just like to point out at this point that I'm an optronics engineer... not a software engineer!

    I have no idea if the site uses a db backend? I'm sorry if I sound thick... I feel way out of my depth!
     
    aquasonic, Apr 4, 2007 IP
  11. druidelder

    druidelder Peon

    Messages:
    285
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    0
    #11
    No worries. If you don't know and you don't have time, I would stick with the multiple include files and the ftp. Just be sure to name the files distinctly enough that people will know what to edit for which page(s).
     
    druidelder, Apr 4, 2007 IP