![]() |
bad tpl formatting help?
I am not a great programmer but can figure out most things pretty well. I have been trying to edit some .tpl files and have found it very difficult. The formatting of the default files is horrible, many levels of nested ifs without indentation and lack of line breaks in reasonable places make it impossible for me. I can't imagine that the original files were constructed in this sloppy formatting. Have they been jumbled to make them unreadable? I can not find an editor anywhere that will provide highlighting or other methods of making ssense of them. Is there a source for files that are formatted well? An editor that will fix up the mess, or do I just have to start by formatting the files myself? I can wrote some perl scripts to do this but I really hope that I don't have to spend the time doing this or reformatting each file.
|
Re: bad tpl formatting help?
Unfortunately that is the way they have always been :(
|
Re: bad tpl formatting help?
so, is the only solution to spend the time making a nicely formatted set? has anyone done that already? if not, i'll probably spend the time to write a perl scrip to tidy them up. the logic might be pretty simple. if anyone has ideas on how to do this, let me know.
|
Re: bad tpl formatting help?
Hi,
I've used this ('tidyrepairhtml' output filter for smarty) with pretty good results: http://www.phpinsider.com/smarty-forum/viewtopic.php?p=24456 You'll need to have tidy built as an extension to PHP, at least that's the only way I have been able to use it. Cheers, Nate |
Re: bad tpl formatting help?
I think I have a Perl script working that helps to make xcart .tpl files more readable. It fixes up nested if statements. So far I have only dealt with the if statements with the assumtion that else and elsif are not likely to be nested. The script seems to make a much more readable file. If there is any interest, I'll share the script and would probably take the time to add indentation for other nested statements such as for loops. Since these are not likely to be nested to the point of confusion, this might not be worth doing. I don't want to write a whole smartytidy script, just want to get the scripts so I can edit them. I can also make an exe to run the indenting script for those who are not running perl scripts.
|
All times are GMT -8. The time now is 07:05 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.