Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Embedding html within html document


  • Please log in to reply

#1
Spider-Man

Spider-Man

    Member

  • Member
  • PipPipPip
  • 167 posts
Hello. I have thought of another idea for the site I am developing.

On every page we display our 'latest products' - this can be done either automatically using Actinic which we use for the 'business section', or manually by editing all the html files.


So, I wondered, is it possible to take the small part of code that displays the new items and put it into a seperate file, for instance, latest.txt - and call this file using <embed src="latest.txt> in the correct position on every page, therefore reducing the workload to just editing one file to add a new product, instead of editing every single page individually?
  • 0

Advertisements


#2
Major Payne

Major Payne

    Retired Staff

  • Retired Staff
  • 5,307 posts
Pretty close. You can use PHP Includes or SSI (Server Side Includes). Pretty handy to do this with all pages that may have same content changes like if you need to add/subtract links lists, etc.. Even to place common footers/headers on all pages. Cuts down on the coding for each *.shtml page (if using SSI).

All that needs to be done is to set it up to place the external file where you want it on each page. Then all you have to do is edit the file that's called. Some go one way by using an iframe set in place then only the iframe page needs to be edited.

Ron
  • 0

#3
Spider-Man

Spider-Man

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 167 posts
Great, thanks alot for the fast response:)

So, do I create .shtml files containing the header, footer and latest products code - thus meaning only one file needs to be edited to add new content in the header/footer/latest products?

Would this be how it is displayed:

<tr>
<embed src="header.shtml"></embed>
</tr>

<tr>
<embed src="footer.shtml"></embed>
</tr>

<tr>
<embed src="latest.shtml"></embed>
</tr>

Obviously those parts of code are located in the correct position on each of the html documents, but am I on the right track as far as linking goes?


Thank you
  • 0

#4
Major Payne

Major Payne

    Retired Staff

  • Retired Staff
  • 5,307 posts
Little more complicated then that. Does your server allow use of Server Side Includes? If so, I'll lead you through how to do it.

Ron

Some reading matter:

Apache SSI Tutorial

SSI: The Include Command

Ron

Edited by Major Payne, 31 July 2007 - 04:58 AM.

  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP