views:

523

answers:

3

This is an issue I've run into with a website I'm designing. I'm using a template based design for the site, so the information on the page is thrown inside the template when the page is accessed. The information shown changes based on the page attribute passed in as a GET request.

So, to actually load the information into the body area of the page, the given PHP script needs to place that information in a $bodyout variable when it ends. This is fine and good, but the information then shows up as a cute yellow box in dreamweaver, making WYSIWYG editing of the site not possible.

Ideally, for most of the pages on the site, I'd like for my secratary to be able to go in there in Dreamweaver to edit the page, since she doesn't know PHP at all. Is there an elegent way to have a PHP script show the data it is going to output in Dreamweaver? (Especially if that data is static)

EDIT I should clarify: By template-based design, I don't mean any particular program. I just have the "layout" HTML/CSS in one script, and that script fills itself with the content. The whole thing is PHP so far, no third party programs involved.

+1  A: 

in short no. if you're using a program that is able to use a different template engine though, it can possibly at least produce valid HTML which won't cause dreamweaver to freak out. it sounds like you might not be the developer of the application generating the templates, but if you're interested, this site explains a bunch of different ideas on templating.

Owen
A: 

I did a very similar thing and I ended up just setting up a web based visual editor. the client could edit the main body of some pages online. That may be your best solution. unfortunetly I don't remember the name of the editor that I could set to edit only certain parts of the page. I will respond again when i find it.
your other option is to use the Dreamweaver templates and set the PHP to load the whole page, header and all. Although Dreamweaver templates are fairly frail and i've had issues with them.

WalterJ89
A: 

Dreamweaver is never going to integrate well into that kind of situation, but it sounds like it might be overkill for your needs anyway, as it's really better suited for page-layout type jobs.

From what you've said, a simple Content Management System with an inline editor like TinyMCE (or whatever) would probably suffice.

da5id