Skip to main content
Participant
November 18, 2008
Question

using php in a template

  • November 18, 2008
  • 3 replies
  • 428 views
I am a new to dreamweaver cs4. My problem is i am trying to add php code to a template (template.dwt) and the php code is not recognized as php code meaning it seems that dreamweaver is interpreting as regular text and not recognizing it as php. php works just fine in my other html pages. what is it that i need to know to make this work?
This topic has been closed for replies.

3 replies

Inspiring
November 18, 2008
Templates do make your life much easier. I use the following scheme....

First, I mentally separate the page layout into three sections:

1. Stuff that will not change for the life of the site (i.e., the basic
structural elements)
2. Stuff that *could* change from time to time (e.g., navigation elements,
burst advertisements, section-specific navigation, etc.)
3. Stuff that *will* change from one page to the next

Then I create a template containing all class1 elements. Next I create
server-side include files containing all class 2 elements and place them on
the template as needed. Note - some of the class 2 elements may be
"section-specific elements", and their placement on the template will be
subject to the next item. Finally, I insert editable regions to cover the
class 3 items, INCLUDING the section-specific navigation.

This allows me to just cookie-cut the rest of the site. I estimate that
even for fairly large sites, about 80% of my work goes into planning and
creating this template file.

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"PeteTheBloke" <webforumsuser@macromedia.com> wrote in message
news:gfur2n$gv5$1@forums.macromedia.com...
>I pretty much stop using templates in DW once I start using php. The reason
>is
> that you
> can do all the things templates do by using includes. That doesn't really
> answer your question but I hope it helps.
>

Participating Frequently
November 18, 2008
I pretty much stop using templates in DW once I start using php. The reason is that you
can do all the things templates do by using includes. That doesn't really answer your question but I hope it helps.
Inspiring
November 18, 2008
kevhan999 wrote:
> I am a new to dreamweaver cs4. My problem is i am trying to add php code to a
> template (template.dwt) and the php code is not recognized as php code meaning
> it seems that dreamweaver is interpreting as regular text and not recognizing
> it as php.

Change the name of the template in Dreamweaver from mypage.dwt to
mypage.dwt.php.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/