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

Can we apply a template to a template

Explorer ,
Jul 04, 2018 Jul 04, 2018

Copy link to clipboard

Copied

and so forth in an infinite nesting...

with dw CC 2018

Views

469
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

correct answers 1 Correct answer

Community Expert , Jul 08, 2018 Jul 08, 2018

You can Save PHP files as Templates.

Go to File > New > PHP file.  Hit Create button.

Insert your include statement.

SaveAs Template and give it the 2nd extension as follows.

mainTemplate.php.dwt

Votes

Translate
Community Expert ,
Jul 04, 2018 Jul 04, 2018

Copy link to clipboard

Copied

If you wish to live dangerously, have a look at Creating a nested template in Dreamweaver

If you wish to have an easy life, have a look at Alt-Web Design & Publishing: Server-Side Includes with PHP , with thanks to Nancy

Wappler, the only real Dreamweaver alternative.

Votes

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 ,
Jul 04, 2018 Jul 04, 2018

Copy link to clipboard

Copied

Nesting Templates is a bad idea.  Just because you can do it, doesn't mean you should.   If you tell us what you're trying to do and why you think nesting templates would help you, maybe we can offer better options.

Nancy O'Shea— Product User, Community Expert & Moderator

Votes

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
Explorer ,
Jul 04, 2018 Jul 04, 2018

Copy link to clipboard

Copied

Thanks Nancy & Ben. I'll tell you more a bit later.

Votes

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
Explorer ,
Jul 08, 2018 Jul 08, 2018

Copy link to clipboard

Copied

It works perfectly fast and simply with PHP. For examples in my site: <?php require_once('includes/creativePouhons.html'); ?>

But, as I have the same menu for all pages based on the main template, I would like <?php require_once('includes/menu.html'); ?> in place of repeating the code of this menu:

-------------------------------------------------------------------

<ul>

<li>

<li>

<a href="/">Home</a>

</li>

<li>

<a href="/creative.php">Creative</a>

</li>

<li>

<a href="/professional.php">Professional</a>

</li>

<li>

<a href="/HealthSport.php">Health and Sport</a>

</li>

<li>

<a href="/Misceallenous.php">Misceallenous</a>

</li>

<li>

<a href="/about.html">About Me</a>

</li>

<li>

<a href="/contact.html">Contact</a>

</li>

</li>

</ul>

-----------------------------------------------------------------------

for <div class="menu full">,

for <div class="menu dropdown">,

for <footer class="container">

      <div class="sixteen columns">

        <nav role="navigation">

As much the include works fine for a. php file as it is rejected and considered an error by a .dwt file. And if I change the .dwt extension to .php, the file loses its template function, I guess.

Could you help me a little bit more?

Votes

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 ,
Jul 08, 2018 Jul 08, 2018

Copy link to clipboard

Copied

You can Save PHP files as Templates.

Go to File > New > PHP file.  Hit Create button.

Insert your include statement.

SaveAs Template and give it the 2nd extension as follows.

mainTemplate.php.dwt

Nancy O'Shea— Product User, Community Expert & Moderator

Votes

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 ,
Jul 08, 2018 Jul 08, 2018

Copy link to clipboard

Copied

If Nancy's answer does not work, try mainTemplate.dwt.php​, it is what works for me

Wappler, the only real Dreamweaver alternative.

Votes

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
Explorer ,
Jul 08, 2018 Jul 08, 2018

Copy link to clipboard

Copied

Merci Ben, j'essaye cela tout de suite car j'ai en effet rencontré des problèmes. En tous cas, vous m'avez tous appris des choses comme un peu de PHP, à quoi ça sert...

Votes

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
Explorer ,
Jul 08, 2018 Jul 08, 2018

Copy link to clipboard

Copied

C'était bien ça. Cela fonctionne parfaitement avec dwt.php

Votes

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 ,
Jul 08, 2018 Jul 08, 2018

Copy link to clipboard

Copied

I now look forward to

For me, it means having a Cognac and a cigar at 4 in the morning. Good luck.

Wappler, the only real Dreamweaver alternative.

Votes

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
Explorer ,
Jul 08, 2018 Jul 08, 2018

Copy link to clipboard

Copied

LATEST

Oui, j'ai regardé les matches avec les "Diables" à partir du moment où ils se sont imposés contre l'Angleterre.

Votes

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