how to edit TPL Files? XHtml?

wprussell

Joined: 2004-08-06
Posts: 9
Posted: Fri, 2004-08-06 17:07

Using Dreamweaver or any other Xhtml editow in design mode ( GUI Mode ) displays all tpl files as Junk. with lots of g->text and no formatting. information.

I prefer not to have to edit the code by hand if I am going to change a layout. (yes .local) Is there a way or an editor that works with all this criptic smarty code?

Thanks!

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Fri, 2004-08-06 17:26

either customize your dreamweaver extensions to display .locale and .tpl as HTML (dreamweaver can do lots of things :)).
or
rename the .tpl / .tpl.locale to .html for editting and when you're finished, save it as .tpl.locale

 
wprussell

Joined: 2004-08-06
Posts: 9
Posted: Fri, 2004-08-06 17:46

I've tried that. Perhaps I'm expecting something other then what i'm getting.
an example....

Open global.tpl under design mode in Dreamweaver. ( See Attachment)

look at the layout. the 2 IMGs are broken as well as any layout deinition. Looking at the source for the images shows {{g->url href=} and not the actual reference for the pic. ( it should say images/gallery.gif ) I was expecting Table Layouts and positioning information as in a nice easy to edit GUI

This thyme is carried out in all G2 TPL files.

Typically PHP TPL files are edited nicely, I suspect its Smarty code for G2 :cry: .

Any Ideas

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Fri, 2004-08-06 17:57

i see, i'm sure you could create a dreamweaver extension for G2 templates, perhaps a smarty extension for dreamweaver already exists.
actually, you can edit these files, create tables with the dreamweaver GUI etc.

the {include file="gallery..."} instructions must be displayed, don't you want to know what content is inserted in the template?

 
wprussell

Joined: 2004-08-06
Posts: 9
Posted: Fri, 2004-08-06 18:19

If you know of a smarty extension please let me know.

Just as an example. If I change the page background color.

I get a smarty error when run.

If I cange the Pic SRC. I get an error as well.

It seems these pages can not be changed. as is.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Fri, 2004-08-06 18:26

I have only a passing familiarity with Dreamweaver. However, I know that the contents of the .tpl files are snippets of valid XHTML 1.0 strict. The Smarty tags that we're using are mostly standard Smarty with a few of our own extensions, but nothing major. So I've got to assume that either Dreamweaver is not capable of editing Smarty files or you're using it incorrectly.

There's pretty much no way that you're going to be able to use Dreamweaver as a WYSIWYG editor for Smarty files, since the bulk of the rendering is dynamic and the all the data you need to display the page isn't going to be there when you're editing the page. This means that no matter what you do, pretty much all URLs are going to be broken (image src urls, anchors, etc) since Dreamweaver won't be able to figure out the right values to put there. I could be wrong, maybe some Dreamweaver expert can shed some light here. However, all Smarty tags are contained in {curly braces} so anything that's not embedded inside an XHTML element should at least show up as plain text.

Furthermore, if you made changes and then got a Smarty error then the odds are that you broke the Smarty code itself by your changes.

Maybe Dreamweaver has a mode where you can edit the source code directly?

 
jmullan
jmullan's picture

Joined: 2002-07-28
Posts: 974
Posted: Fri, 2004-08-06 18:59
 
thumb
thumb's picture

Joined: 2004-05-26
Posts: 238
Posted: Sat, 2004-08-07 03:23

The link jmullan posted will help anyone who get's the message that Dreamweaver doesn't recognize the .tpl extension. Getting Dreamweaver to process Smarty, let alone PHP, in it's design view just won't happen. You must edit the code in Dreamweaver's code view and look at pages after they've been processed by the PHP module on your web server.

I don't think there are any WYSWUG HTML editors that process and display PHP output.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2004-08-07 08:31

The php code coloring and knowing what a comment is etc. is all defined in a dreamweaver config which is very extensible. but even dreamweaver has not WYSIWYG for php, of course not. and you won't have WYSIWYG for smarty.
but you can configure dreamweaver to highlight smarty tags, hide comments etc., that's what the above link is for.

 
wprussell

Joined: 2004-08-06
Posts: 9
Posted: Mon, 2004-08-09 17:15

Thanks, That answers alot!

Bill Russell

 
elmo23

Joined: 2005-02-14
Posts: 6
Posted: Tue, 2005-02-15 13:19

actually dzsoft php editor will come a long way
just hit the previeuw button and it shows ya the webby as its gonna work AFTER you messed with the codes
no need for saving first even
and undo will be still there :)

 
jetbrains

Joined: 2006-06-01
Posts: 2
Posted: Thu, 2006-06-01 14:11

TPL files are snippets of valid XHTML 1.0 strict.
Many php systems use it just like jsp using XML

Funny Jokes

 
msdnvp

Joined: 2007-10-13
Posts: 5
Posted: Sat, 2007-10-13 20:27

why on earth would the devs use tpl. they just made it impossible to edit it in WYSWUG editors.

? with so many formats out there.

asp.net
asp
php
jsp
so many with WYSWUG support.

whats with you guys i'v seen so many good open source projects. use TPL

come on stop with that shit ! if you want progress TPL aint the way forward.

 
desiredbard

Joined: 2006-07-05
Posts: 80
Posted: Thu, 2007-11-08 19:44

MS?dnvp

asp.net and asp good?????
The reason being probably that MS messed up a lot for people like me.
TPL as far as I get it, or rather smarty has to do with content management.

Now I'm strugling here as well in order to move things around on the page.
But I will get there

Hell anyone here how I get the maccintosh i am going to buy to dualboot on linux/unix... i just hate how ms brainwashed i am.

 
intrebulon

Joined: 2008-01-19
Posts: 1
Posted: Sat, 2008-01-19 09:54
wprussell wrote:
Using Dreamweaver or any other Xhtml editow in design mode ( GUI Mode ) displays all tpl files as Junk. with lots of g->text and no formatting. information.

I prefer not to have to edit the code by hand if I am going to change a layout. (yes .local) Is there a way or an editor that works with all this criptic smarty code?

Thanks!

How to edit TPL files in WYSIWYG mode in Dreamweaver MX and Adobe GoLive

http://www.phpbb.com/community/viewtopic.php?t=141613

 
dcnc

Joined: 2006-05-30
Posts: 19
Posted: Mon, 2008-01-21 19:49

All you have to do is just choose the "Code" view display option in Dreamweaver and it will display just fine.

 
dcnc

Joined: 2006-05-30
Posts: 19
Posted: Mon, 2008-01-21 19:51

.