Rebuild This Template
UPDATE 09/06: Rebuild Site
One of my favourite features in MT 3.1 is the "Rebuild This Template" button that appears when you save a template. When you click that button it doesn't popup another window for you to confirm the rebuild, no, it just rebuilds then and there. Unfortunately the button at the bottom of the page doesn't do the same. Also because my template body field is huge, that bottom button is quite far down so I have to scroll for a bit. These two annoyances led me to hack the edit_template.tmpl file found MTDIR/tmpl/cms/, this hack is only available in MT 3.1 and greater. If you feel uncomfortable with hacking files but would like to have this hack, please contact me and I will quote you a price for the installation.
Top Rebuild Button
Around line 121 you will see
</div>
</TMPL_IF>
Actually you will see two blocks that look like the above, you want to look at the second. Replace the second set with the following:
<TMPL_UNLESS NAME=NEW_OBJECT> <TMPL_UNLESS NAME=BUILD_DYNAMIC> <TMPL_IF NAME=HAS_REBUILD> <form class="inline" action="<TMPL_VAR NAME=SCRIPT_URL>" onsubmit="return false;"> <input type="button" onClick="window.location='<TMPL_VAR NAME=SCRIPT_URL>?__mode=start_rebuild&blog_id=<TMPL_VAR NAME=BLOG_ID>&next=0&type=index-<TMPL_VAR NAME=ID>&tmpl_id=<TMPL_VAR NAME=ID>&single_template=1'" value="<MT_TRANS phrase="Rebuild">" /> </form> </TMPL_IF> </TMPL_UNLESS> </TMPL_UNLESS> </div> </TMPL_IF>
Bottom Rebuild Button
Now we'll edit the rebuild button found at the bottom of the page. Normally if you click this button, it would popup a window and make you click another button to actually initiate the rebuild, not anymore. Search edit_template.tmpl for the following line
<input type="button" onclick="doRebuildOne(<TMPL_VAR NAME=ID>)" value="<MT_TRANS phrase="Rebuild">" />
and replace it with
<form class="inline" action="<TMPL_VAR NAME=SCRIPT_URL>" onsubmit="return false;"> <input type="button" onClick="window.location='<TMPL_VAR NAME=SCRIPT_URL>?__mode=start_rebuild&blog_id=<TMPL_VAR NAME=BLOG_ID>&next=0&type=index-<TMPL_VAR NAME=ID>&tmpl_id=<TMPL_VAR NAME=ID>&single_template=1'" value="<MT_TRANS phrase="Rebuild">" /> </form>
A day after I implemented this hack, the "Rebuild Site" button on the left navigation menu still caused popups and annoyed me so, I hacked that template as well:
First open up header.tmpl and search for
href="#" onclick="window.open('<TMPL_VAR NAME=SCRIPT_URL>?__mode=rebuild_confirm&blog_id=<TMPL_VAR NAME=BLOG_ID>', 'rebuild', 'width=400,height=300,resizable=yes')"
and replace it with
href="<TMPL_VAR NAME=SCRIPT_URL>?__mode=rebuild_confirm&blog_id=<TMPL_VAR NAME=BLOG_ID>"
Next, in three templates:
- rebuild_confirm.tmpl
- rebuilding.tmpl
- rebuilt.tmpl
find at the top
<TMPL_INCLUDE NAME="header-popup.tmpl">
and replace it with
<TMPL_INCLUDE NAME="header.tmpl">
and then do the same with the bottom of the templates:
<TMPL_INCLUDE NAME="footer-popup.tmpl">
becomes
<TMPL_INCLUDE NAME="footer.tmpl">
Finally, delete the following line from rebuilt.tmpl
<input type="button" onclick="window.close()" value="<MT_TRANS phrase="Close">" />
and voila ! All rebuilds in Movable Type are done within the system, no popups whatsoever !
If you feel uncomfortable with hacking files but would like to have this hack, please contact me and I will quote you a price for the installation.

Andrew Quinn, "Whiz Kid" said:
on Sep 6, 2004 3:33 AM | Reply
This is off-topic here, but your Ask Arvind function is broken.
Arvind Satyanarayan said:
on Sep 6, 2004 7:47 AM | Reply
Damn don't know what's happened to that, new server. Thanks for telling me.
Jason said:
on Sep 7, 2004 12:35 AM | Reply
Any chance of having a Save & Rebuild button? That's the main thing I do - save, rebuild, test/look, edit, repeat. That would be great if you could figure out how to do that. Great hack, btw.
Arvind Satyanarayan said:
on Sep 7, 2004 5:29 PM | Reply
That would be useful, for that I'd have to hack the actual perl files and since I barely know perl could be quite difficult. I'll have a look but I'll also put in a feature request with the devs.....