PDA

View Full Version : vb 2.02 : View templates inline (great for upgrades)


dwh
31 Jul 2001, 03:04
Updated 07/30/01 for vb2.02 plus added feature of Preview of "View Original" now in the same screen and side by side!

To make it easier to upgrade templates, as well as see what a template looks like, Set up a Preview by following these instructions:

1. Open template.php.

2. Look for line 78-79 (in the Start Add section)
makehiddencode("group", "$group");
doformfooter("Save");

3. DIRECTLY After that add echo "<b>Preview Code Placement:</b>
<hr>$template<hr><b>Preview Page Layout:</b><hr>\n";
eval("dooutput(\"".gettemplate("$title")."\");");


4.Look for line 114-115 (in the Start Edit section)
makehiddencode("group", "$group");
doformfooter("Save Changes");

5. DIRECTLY After that add $templatesetid=$template[templatesetid];
echo "<b>Preview Code Placement:</b><hr>$template[template]<hr>
<b>Preview Page Layout:</b><hr>\n";
eval("dooutput(\"".gettemplate("$template[title]")."\");");
echo "<hr>Here's the original template";
$action="view";
$title="$template[title]";
$custom_template="$template[template]";

6. Look for line 127 (in the Start View section)
echo "</table>\n</td></tr></table></form>";

7. DIRECTLY After that add echo "<b>Preview Code Placement:</b>
<hr>$template[template]<hr><b>Preview Page Layout:</b><hr>\n";
eval("dooutput(\"".gettemplate("$title")."\");");
$original_template="$template[template]";
echo "<hr>Here's the 2 side by side<form>
<table><tr><td width=50%><TEXTAREA COLS=60 ROWS=20>$custom_template</textarea></td>
<td width=50%><TEXTAREA COLS=60 ROWS=20>$original_template</textarea></td></tr>
<tr><td width=50%>$custom_template</td>
<td width=50%>$original_template</td></tr></table></form>";

I added a bunch of carriage returns as before this edit the screen got really wide, but if you have problems, remove the carriage returns.

PS It does look a bit weird with custom templates, but other than that it looks like it'll be a big help.

Partial Screenshot below:

\/ash
31 Jul 2001, 04:28
YES! I love this!

snyx
31 Jul 2001, 05:51
now THIS I like.

VirtueTech
31 Jul 2001, 15:09
Will this work on 2.0.1?

dwh
31 Jul 2001, 15:15
I'm 99% sure it'll work on 2.01, but if you have any problem, you can go to the version I wrote for 2.01.

ldydvr
01 Aug 2001, 19:13
Have you done this with your v2.0.3 yet too?

dwh
01 Aug 2001, 19:33
Yes..but I have to admit it's pretty kludgy. I'll have to revisit it when I get time to make it better.