Dear all,

I'm looking for solutions. I'm using Dreamweaver, I made a website HTML + CSS. As an Example if I want to put Yahoo:
[IMG][/IMG]

Inside this Area the Black box:
[IMG][/IMG]

Without using iFrames. What do you recommend?

Thanks.

Dani AI

Generated

Good call by — composing pages from smaller files instead of iframes is the standard way to nest templates. was also right that a full redesign sometimes makes sense, but using include/fragment strategies gives much better long‑term maintainability: update one partial and every page that includes it updates automatically. For anyone who found this thread later (hi ), below are practical options, example patterns, and common pitfalls.

Server-side includes (recommended when you can run server code). Use PHP include/require or Apache SSI so the server assembles the final HTML before sending it to the browser. Example with PHP:

<?php
include __DIR__ . '/partials/head.php';
include __DIR__ . '/partials/nav.php';
include __DIR__ . '/partials/content.php';
include __DIR__ . '/partials/footer.php';
?>

Files must be served by a PHP‑enabled server (local testing: the built‑in PHP server). See the PHP manual for the include function and the built‑in server (PHP include, built‑in webserver).

Client-side alternatives (when you only have static hosting). Load fragments with Fetch and inject them into containers — useful for prototypes or static hosts, but note SEO and JS‑disabled users won’t see content the same way:

fetch('/partials/sidebar.html')
  .then(r => r.text())
  .then(html => document.getElementById('sidebar').innerHTML = html);

Also consider the HTML <template> element or Web Components for reusable pieces (MDN Fetch API, HTML template).

Troubleshooting and cautions: watch relative vs absolute paths (includes resolve on the server), avoid duplicating CSS/JS across fragments, prevent duplicate IDs, ensure injected scripts execute as expected, and check server logs if includes fail. If you use Dreamweaver, use its template (.dwt) or library features so the editor can manage regions for you ().

Recommended Answers

All 6 Replies

Well, for that you actually have to edit the whole template to have features of other templates...It's almost a tricky and a time consuming. May be it would be better if you do everything from the start in the black area for a perfect result

I did found a solution, to use "Include" and it worked very good.
Thanks mate.

can you tell us what you did ?

can you tell us what you did ?

I used the "include" type, for example:
header.inc
main.inc...etc
and inside the
main.inc
I put the other template, so it becomes template inside template.

ah .. thanks man

ah .. thanks man

no problem =]

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.