I have created a site using templates and I want to insert a status bar message on one page. Any ideas where I can put this code on the page as I cant edit the body tag on this specific page, only on the template.

Dani AI

Generated

: Dreamweaver templates lock structural tags, so you cannot reliably edit the page body unless the template exposes an editable region. The one-line placement tip from is brittle — counting lines or placing script by line number will break when templates or formatting change. Two practical, maintainable approaches follow.

Best: add an editable region to the template where per‑page messages belong. Open the .dwt, insert an Editable Region (give it a name like pageStatus), place it where a status banner or script call should go, save the template, then edit that region on the single page. This keeps the site manageable and preserves template updates.

If you cannot change the template, detach that page from the template (so you can edit it directly) — note this stops automatic template updates for that page.

Prefer a visible, accessible status banner instead of window.status (modern browsers ignore or block it). Put this markup+script in the template, and call showStatus() from the page’s editable region when needed:

<div id="page-status" role="status" aria-live="polite"
     style="position:fixed;bottom:0;left:0;right:0;background:#222;color:#fff;padding:8px;text-align:center;display:none;z-index:9999;">
  <span id="page-status-text"></span>
</div>

<script>
function showStatus(msg,timeout){
  var d=document.getElementById('page-status'), t=document.getElementById('page-status-text');
  t.textContent=msg; d.style.display='block';
  setTimeout(function(){ d.style.display='none'; }, timeout||4000);
}
</script>

Call showStatus('Your message') from the page-specific editable region. This is cross‑browser, accessible (ARIA live), and maintainable.

Member Avatar for Member #120589

Yeah, put it on the tenth line after the close div tag.

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.