• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Linking pages to a template

Contributor ,
Feb 21, 2021 Feb 21, 2021

Copy link to clipboard

Copied

Hi everyone,

 

I am building a site using a template, but for some reason a large number of the pages are not linked, even though I used the same template to create all the pages. I built each and every page the same way. Often, when updating template pages, Dreamweaver stalls—it does nothing. After repeated attempts, I have to restart the computer. Otherwise, I can't update the pages.

 

The pages are all built off the same template. Is there a way I can link these pages to it, so that I don't have to create them all over again? 

 

Thanks for any help you can provide.

 

Mark

TOPICS
How to

Views

862

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 21, 2021 Feb 21, 2021

Copy link to clipboard

Copied

Each of the child pages will have a link to the template. In Dreamweaver, the link is coloured green. Check each of these links to ensure they are correctly formatted. Also make sure that the editable regions are correct.

 

Having said that, Dreamweaver's templating system is very outdated. Most developers choose to use server side includes instead. There are other templating engines out there if you wnt to stick with templates. The most common is Smarty

 

As for me, I use Node/Express/EJS.

Wappler, the only real Dreamweaver alternative.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 21, 2021 Feb 21, 2021

Copy link to clipboard

Copied

Hi Ben,

 

Thanks. It's the strangest thing. The files that will not update look exactly like those that do. I've done this before, so I know I did this correctly. The template only has one edible region, so I tried to link them to the template via Tools>Template>Link Page to Template. Oddly enough, some worked and some didn't. A few I had to try multiple times, and a few still didn't update. I'm going to trash the site and start again. 

 

Kind regards,

 

Mark

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 21, 2021 Feb 21, 2021

Copy link to clipboard

Copied

I just created a new template and it won't even update the first page I created. I have the "update pages when template changes" checkmarked. What is the proper way to update the pages? I normally select File>Save All, and then it asks if I want to update the template pages. Is there a better way? 

 

Thanks.

 

Mark

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 21, 2021 Feb 21, 2021

Copy link to clipboard

Copied

If you have the site published, please give us the link to the site. Otherwise, paste the full code of the template here. That way we cn see what you are doing.

Wappler, the only real Dreamweaver alternative.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 22, 2021 Feb 22, 2021

Copy link to clipboard

Copied

Hi Ben,

 

Thanks for your help. Here is the code from the template. It would appear as though the pages are being created successfully, the problem lies when trying to update them. For some reason, the template fails to recognize all of them. I don't see how I could be doing it incorrectly because the process is straightforward and applies to all pages equally. The template only has one editable region.

 

Mark

 

<!doctype html>
<html lang="en">
<head>
<meta id="p7HMY" name="viewport" content="width=device-width">
<meta charset="UTF-8">
<!-- TemplateBeginEditable name="doctitle" -->
<title>Panama</title>
<!-- TemplateEndEditable -->
<!--Fancy Box-->
<script src="https://cdn.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css"/>
<script src="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js"></script>
<!--Strip-->
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="../strip/js/strip.pkgd.min.js"></script>
<link rel="stylesheet" type="text/css" href="../strip/css/strip.css"/>
<!--Google Fonts-->
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Lato:wght@400;700&family=Raleway:wght@400;500;600;700&displ..." rel="stylesheet">
<!--P7-->
<link href="../p7hmy/p7HMY-01.css" rel="stylesheet" type="text/css" media="all">
<link href="../p7hmy/custom-styles.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="../p7hmy/p7HMYscripts.js"></script>
<!-- TemplateBeginEditable name="head" -->
<!-- TemplateEndEditable -->
</head>

<body>
<div id="p7HMY_1" class="p7HMY hmy-noscript" data-hmy-max-width="1100,px">
<div class="hmy-section" data-hmy-basis="100,%,1">
<div class="hmy-content-wrapper header">
<div class="hmy-content hmy-no-pad hmy-center">
<img src="../images/panamaflag.png" width="191" height="112" alt=""/> </div>
</div>
</div>
</div>
<!-- TemplateBeginEditable name="Main_Content_Region" -->
<div id="p7HMY_2" class="p7HMY hmy-color-root-white hmy-noscript" data-hmy-max-width="1100,px">
<div class="hmy-section" data-hmy-basis="100,%,1">
<div class="hmy-content-wrapper mainContent">
<div class="hmy-content hmy-left">
<h3>Column 1</h3>
<p>Lorem ipsum dolor sit amet, ne sea vocent scripta abhorreant, facilisi explicari mel ne, ut quo vide ridens. Mei ex quodsi in</p>
</div>
</div>
</div>
</div>
<!-- TemplateEndEditable -->
<div id="p7HMY_3" class="p7HMY hmy-noscript" data-hmy-max-width="1100,px">
<div class="hmy-section" data-hmy-basis="100,%,1">
<div class="hmy-content-wrapper footer">
<div class="hmy-content hmy-center">
<p>&copy;2021 <a href="http://www.worldheadquarters.com" class="copyright" title="Worldheadquarters">Worldheadquarters</a></p>
</div>
</div>
</div>
</div>
</body>
</html>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 22, 2021 Feb 22, 2021

Copy link to clipboard

Copied

Had a look at the template. made child pages, modified the template and said yes to update child pages, all went well.

 

In other words, I cannot replicate the problem.

 

Have a look at how this guy does it:

https://www.youtube.com/watch?v=FFH0ALqS1XY

Wappler, the only real Dreamweaver alternative.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 22, 2021 Feb 22, 2021

Copy link to clipboard

Copied

Hi Ben,

 

OK, that's good news. What is the best way to update the pages, or doesn't it matter? What exactly did you do to update the child pages? Normally, after working on the .dwt file, I choose Save All, at which time I'm asked if I want to update all the pages. Is this the best option, or would choosing Tools>Template>Update Pages be better? I'm guessing it's the same, but just want to be sure.

 

Thanks. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 23, 2021 Feb 23, 2021

Copy link to clipboard

Copied

My advice would be to ditch DW templates, they are outdated and often become disfunctional. 

 

You should investigate 'include' files be it .shtml or .php, both are more stable and give you less problems. You could even just use plain old vanilla javascript to build 'static' content page areas.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 22, 2021 Feb 22, 2021

Copy link to clipboard

Copied

Assuming your main template.dwt file isn't corrupted, try Restore Preferences. This fixes most problems in DW.

https://helpx.adobe.com/dreamweaver/kb/restore-preferences-dreamweaver.html

 

Nancy O'Shea— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 22, 2021 Feb 22, 2021

Copy link to clipboard

Copied

Thanks Nancy. I do think it needs to be done because it acts up regularly. 

 

Is there any way to determine the number of child pages there are for any given .dwt file? I don't see anything under the Site or Tools menus.

 

Thanks.

 

Mark

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 23, 2021 Feb 23, 2021

Copy link to clipboard

Copied

Is there any way to determine the number of child pages there are for any given .dwt file?

==========

Mark,

I don't know of any.   Each child page refers to it's own template, but templates don't keep track of child pages except internally.  For a lot of reasons, I don't use DW proprietary templates.  They rely entirely on DW to work and as such are prone to failures.  For what I do, server-side includes are much faster and more efficient than DW templates.

https://alt-web.blogspot.com/2015/07/server-side-includes-with-php.html

 

Nancy O'Shea— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 23, 2021 Feb 23, 2021

Copy link to clipboard

Copied

If the child pages have been created correctly from the Template...

1. In DW, Go to File > New...
2. In the first column, choose Site Templates
3. In the second column, choose the site you are working on
4. In the third column, choose the template file you want
5. Hit Create

...DW will add a line of code to just after the opening <html> tag of each child that points to the .dwt file, something like...

<!-- InstanceBegin template="/Templates/MyAwesomeTemplate.dwt" codeOutsideHTMLIsLocked="false" -->

 All you need to do, to know how many pages are connected to a given template in your site, is to do a Find All on that link string...

 

1. Hit Ctrl/Cmnd + Alt + F
2. Click the Basic header
3. In the first large field, add the template folder and file name you're looking for, from my example above it would be...

Templates/MyAwesomeTemplate.dwt

 

4. For "In" change it to "Entire Current Local Site" and leave the next dropdown set to [any tag]
5. Leave the Replace field empty
6. Click Find All

This will give you a list of every page that is currently linked to a given template in your Search window, along with the number of times it appears in the number of files searched in your site. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 23, 2021 Feb 23, 2021

Copy link to clipboard

Copied

Good thinking!  It didn't occur to me to use a sitewide Find for the template.dwt name. 

That's a very clever idea.

 

Nancy O'Shea— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 23, 2021 Feb 23, 2021

Copy link to clipboard

Copied

If you want a robust system that utilises Dreamweaver's template system, have a look at http://www.webassist.com/dreamweaver-extensions/framework-builder

 

Using this extension allows you to update the template independant of the child pages and vice versa. Used it a lot prior to changing from PHP to NodeJS

Wappler, the only real Dreamweaver alternative.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 24, 2021 Feb 24, 2021

Copy link to clipboard

Copied

LATEST

I work very often with templates and the behavior you encounter happens frequently. As OS says, it's a little dated mechanics, which receives a lot of contraindications over the years ...
anyway, I still use it... you don't change bad habits (joke)
so when the child pages do not update with the parent template update, it is important to explicitly make sure that all the internal links are restored, for this, two operations are necessary:
1 - open the Assets panel, and from the contextual menu at the top right, recreate the site list
2 - then open the various child pages, and always from the assets panel, drag and drop the ad hoc template on the page (over the display mode) in order to reactivate the application of the template. normaly a small asterisk should appear on the page tab beside the filename... proof that something was wrong

 

normally everything should be in order now...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines