View Single Post
Old 09-21-2002, 01:28 PM
  minorgod's Avatar 
minorgod minorgod is offline

Join Date: Sep 2002
Location: Arivaca, AZ
Posts: 402

Default That defeats the purpose...

That would work fine if you didn't care about being able to VISUALLY edit the page, having Dreamweaver render tables and such. In order to get DreamweaverMX to render the HTML contained in a .tpl file that contains no obvious HTML start and end tags, you'll need to give it a clue that there is renderable HTML in the file, which is why you need to add the
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
tag to your .tpl file as the very first line of code. You can do this within Dreamweaver and then save the file and Dreamweaver will magically reload and parse the page, rendering all your tables for easier layout. You can then use Dreamweaver's visual tools to drag Smarty code from one table to another and rearrange the layout of the template.

For added convenience, users may also wish to add the .tpl file type to their Dreamweaver preferences so they can open .tpl files from within Dreamweaver by double-clicking on them.

The only place you may have to worry about Dreamweaver breaking your page is when using special characters such as the Smarty {} tags which Dreamweaver will change into their HTML-encoded equivalents when cutting and pasting them from one table to another. Dreamweaver will not touch or otherwise try to convert any code you don't specifically cut and paste. That's the kind of thing you probably couldn't say about FrontPage or Adobe GoLive, so be careful if you try it with other visual editors. Other than that, Dreaweaver will not harm any of your code as it makes no attempt to parse or rewrite anything it doesn't specificaly recognize via it's syntax definitions. Dreamweaver is generally very good about ignoring code it doesn't recognize.

It would also be possible to write Dreamweaver data translators that would parse the smarty code and render it properly on screen, the same way DreamweaverMX currently does with PHP or ASP. But if you can do that, then you sure as heck don't need to be wasting your time reading this.
Getting back into x-cart dev after a long hiatus. Modded lots of x-carts from version 3.1.x to 4.1.x. Developer of ImageScaler mod, Pre-login per user coupon mod, Wordpress feed mod, DigitalSubscriptions mod, Phonetic bulk download keys addon for DownloadExpander mod, Serial Number Generator for ESD products, Custom CMS/LMS integrations, external products mod, and more.
Reply With Quote