X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Forum FAQs and guides (https://forum.x-cart.com/forumdisplay.php?f=30)
-   -   How to edit templates in Dreamweaver (https://forum.x-cart.com/showthread.php?t=21704)

bob 12-09-2002 08:57 AM

Can't get Smarty to work in Dreamweaver
 
mg, I followed the instructions from your last post, however, I can't seem to get Dreamweaver MX to show smarty code as anything other than icons. Also, when I view a template in the browser (through Dreamweaver) I see nothing but code.

Do I need to copy the Smarty folder to some root directory? Do I need to edit another Dreamweaver config file somewhere?

Any insite would be greatly appreciated.

minorgod 12-09-2002 01:53 PM

sounds right...
 
I think you probably did it correctly, but you're expecting a bit too much from Dreamweaver. Dreamweaver won't render the actual SMARTY code, but should just display raw smarty code as if it were HTML. Only the non-smarty parts of your templates will render properly as HTML. Basically, this lets you create an HTML file with a .tpl extension, or to view an HTML file with a .tpl extension. Any code that is not part of an HTML tag will show up as text. So it's not a total WYSIWYG solution, but it's better than nothing. You should at least be able to change the layout of your pages and drag bits of SMARY code around the page to place it in different locations in your template. Regardless of how it appears in Dreamweaver, you'll still need a good understanding of SMARY tags if you hope to be able to modify the templates. To make the actual SMARTY code markup render in DreamweaverMX would require writing an entire server model that could properly enterpret all the various SMARTY tags. While you could probably build one based on the PHP server model, I doubt anyone other than serious SMARTY / Dreamweaver extension developers could attempt such a feat. I've built some DreamweaverMX extensions for the PHP-MySQL server model and I can assure you, it would be difficult (but not impossible) to write an extension that would render SMARTY tags.

guytje 03-25-2003 06:18 AM

An easier way...
 
Maybe an easyer way (always works):

You can also rename the tpl to tpl.html and then just open them in dreamweaver... no worries!

Just be sure that when copying it back the the server he doesn't put a

</p> tag at the first line...

AND also: alsways make regular backup copies of correct pages.

Cheers,
Guy

groovico 05-04-2003 03:06 PM

Re: An easier way...
 
Quote:

Originally Posted by guytje
Maybe an easyer way (always works):

You can also rename the tpl to tpl.html and then just open them in dreamweaver... no worries!

Just be sure that when copying it back the the server he doesn't put a

</p> tag at the first line...

AND also: alsways make regular backup copies of correct pages.

Cheers,
Guy


Nope better yet rename it to .php as dreamweaver will not alter the code then at all.

Also change the URL rewriting in preferences to avoided having dreamweaver re-write your coded links :)

minorgod 05-05-2003 07:46 AM

It seems like different versions of DreamweaverMX might be behaving differently, but the instructions I posted above seem to work great on both my home and work copies.

It sounds like you still need to add the .tpl extension to your list of default editors in your DreamweaverMX prefs. Open your prefs menu in dreamweaver...

edit-->preferences-->file types/editors

Now add the .tpl file extension to the list on the left, and associate it with Dreamweaver by adding dreamweaver to the editors list on the right.

Click done. You're done. Now you should be able to open those pesky .tpl files.

shan 05-11-2006 06:47 AM

http://smartydwt.klitsche.org/


All times are GMT -8. The time now is 10:41 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.