# HTML/CSS insertion

**URL:** <https://boards.straightdope.com/t/html-css-insertion/219875>\
**Category:** Factual Questions\
**Created:** [December 19, 2003, 12:01am UTC](https://boards.straightdope.com/t/html-css-insertion/219875 "2003-12-19T00:01:21Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![II\_Gyan\_II](https://avatars.discourse-cdn.com/v4/letter/i/bbe5ce/32.png) [@II\_Gyan\_II](https://boards.straightdope.com/u/II_Gyan_II)\
**Post date:** [December 19, 2003, 12:01am UTC](https://boards.straightdope.com/t/html-css-insertion/219875/1 "2003-12-19T00:01:21Z")

</div>

I’ve just about gotten to putting up my website. I’ve a header + 2 column layout. In my ‘links’ section, I intend to present the categories in the left hand column, the corresponding links in the main content column. The problem is, if I have to insert a new category, I’ll have to go through all ‘links’ pages and insert that code.

Short of installing a CMS or having the categories come up in only the root page, is there a way to streamline this? Hopefully, there’s a XHTML tag like \<insert source=“[http://this.url](http://this.url)” code-id=“name” /\>

---

<div class="post-metadata">

**Author:** ![friedo](https://avatars.discourse-cdn.com/v4/letter/f/8edcca/32.png) [@friedo](https://boards.straightdope.com/u/friedo)\
**Post date:** [December 19, 2003, 12:08am UTC](https://boards.straightdope.com/t/html-css-insertion/219875/2 "2003-12-19T00:08:59Z")

</div>

Sounds like you want to use Server Side Includes. Ask your hosting provider if it’s available. The assembled includes appear as a single file to the browser, which is much more reliable than trusting a browser to adhere to any kind of standards.

---

<div class="post-metadata">

**Author:** ![GuanoLad](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/guanolad/32/42_2.png) [@GuanoLad](https://boards.straightdope.com/u/GuanoLad)\
**Post date:** [December 19, 2003, 12:10am UTC](https://boards.straightdope.com/t/html-css-insertion/219875/3 "2003-12-19T00:10:09Z")

</div>

Two ways. One is use Frames, so the same menu is on every page. Many people don’t like Frames, however, and it can be quite ugly if used badly.

The other way is to use an HTML app that uses an _Extended Find And Replace_ function, which doesn’t just change stuff on one page, but on all pages in a specified location.

---

<div class="post-metadata">

**Author:** ![GuanoLad](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/guanolad/32/42_2.png) [@GuanoLad](https://boards.straightdope.com/u/GuanoLad)\
**Post date:** [December 19, 2003, 12:11am UTC](https://boards.straightdope.com/t/html-css-insertion/219875/4 "2003-12-19T00:11:22Z")

</div>

Oh yeah, you could use SSI, that’s true. But they can be problematic to setup.

---

<div class="post-metadata">

**Author:** ![II\_Gyan\_II](https://avatars.discourse-cdn.com/v4/letter/i/bbe5ce/32.png) [@II\_Gyan\_II](https://boards.straightdope.com/u/II_Gyan_II)\
**Post date:** [December 19, 2003, 12:15am UTC](https://boards.straightdope.com/t/html-css-insertion/219875/5 "2003-12-19T00:15:56Z")

</div>

I just looked at my hosting provider’s features page and SSI is included. Is there an universal way to invoke them or does it depend on my host’s setup(Redhat 7.2/Apache) ?

---

<div class="post-metadata">

**Author:** ![fezpp](https://avatars.discourse-cdn.com/v4/letter/f/da6949/32.png) [@fezpp](https://boards.straightdope.com/u/fezpp)\
**Post date:** [December 19, 2003, 3:59pm UTC](https://boards.straightdope.com/t/html-css-insertion/219875/6 "2003-12-19T15:59:27Z")

</div>

To do a server side include you are required to use a server side language (eg. Java, ASP, PHP). What this means is that when a page is requested the server goes through the page carrying out any dynamic instructions before returning the html source to your browser.  
From the limited description of your host I’m guessing that they will offer PHP (which is actually a fairly good place to start) as a server side language.  
A simple example of using PHP SSI is included [here](http://www.developerfusion.com/show/3703/9/).  
Once you start playing with PHP and server side functonality you will find how many more interesting things you can do with web sites.

---

<div class="post-metadata">

**Author:** ![Duckster](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/duckster/32/1244_2.png) [@Duckster](https://boards.straightdope.com/u/Duckster)\
**Post date:** [December 19, 2003, 6:26pm UTC](https://boards.straightdope.com/t/html-css-insertion/219875/7 "2003-12-19T18:26:54Z")

</div>

> [@](#):
>
> \*Originally posted by fezpp \*  
> \*\*To do a server side include you are required to use a server side language (eg. Java, ASP, PHP). \*\*

Not true.

Using SSIs does not require the use of Java, ASP or even PHP. SSIs predate Java, ASP and PHP. If SSIs are enabled on a server, it is relatively easy to use, along with the required .shtml suffix for web pages.

Bignosebird has an SSI tutorial - see [http://bignosebird.com/ssi.shtml](http://bignosebird.com/ssi.shtml)

Also see -

- [http://hoohoo.ncsa.uiuc.edu/docs/tutorials/includes.html](http://hoohoo.ncsa.uiuc.edu/docs/tutorials/includes.html)
- [http://www.carleton.ca/~dmcfet/html/ssi.html](http://www.carleton.ca/~dmcfet/html/ssi.html)
- [http://www.freewebmasterhelp.com/tutorials/ssi](http://www.freewebmasterhelp.com/tutorials/ssi)

---

<div class="post-metadata">

**Author:** ![Tim\_T-Bonham.net](https://avatars.discourse-cdn.com/v4/letter/t/46a35a/32.png) [@Tim\_T-Bonham.net](https://boards.straightdope.com/u/Tim_T-Bonham.net)\
**Post date:** [December 19, 2003, 8:18pm UTC](https://boards.straightdope.com/t/html-css-insertion/219875/8 "2003-12-19T20:18:53Z")

</div>

> [@](#):
>
> \*Originally posted by Gyan9 \*  
> \*\*The problem is, if I have to insert a new category, I’ll have to go through all ‘links’ pages and insert that code.  
> \*\*

Use the proper tool. A good quality programming editor (which is quite different from a text editor or word processor) will have functions that allow you to make global find-and-replace changes over a range of files, rather than having to edit it manually in each file. With such a tool, this ‘problem’ goes away altogether.
