tags:

views:

17

answers:

1

Is it possible to reference one xhtml file (say a menu) from multiple xhtml files? Sort of like how external css is used to avoid multiple instances of the same code.

I want the layout to reside in one place in case I need to make changes later on.

+1  A: 

You need to use some kind of server side scripting language to import your template files. In PHP, you could do something like this:

<html>
<head>
</head>
<body>
    <?php include('menu.html'); ?>
    <div id="content">
        Page specific content here.
    </div>
    <?php include('footer.html'); ?>
</body>
</html>

XHTML on itself does not support importing files.

Tatu Ulmanen