Build Dynamically?

Almost all my blogs have the "Set Each Template's Build Options Separately" option selected and the dynamic setting on my hundreds of templates is varied. I wanted to be able to see immediately which templates were and which templates were not rebuilt dynamically from the templates listing view. A screenshot of how this look is above (click for a larger view) Obviously, this hack is only valid for MT versions equal to or greater than 3.1

You will need your list_template.tmpl file. Find

<th width="20%"><MT_TRANS phrase="Build w/Indexes"></th>

and replace it with

<TMPL_IF NAME=DYNAMIC_CUSTOM><th width="10%"><MT_TRANS phrase="w/Indexes"></th> <th width="10%"><MT_TRANS phrase="Dynamic"></th> <TMPL_ELSE> <th width="20%"><MT_TRANS phrase="Build w/Indexes"></th></TMPL_IF>

Next, find

<td><TMPL_IF NAME=REBUILD_ME><MT_TRANS phrase="Yes"><TMPL_ELSE><MT_TRANS phrase="No"></TMPL_IF></td>

and add underneath it

<TMPL_IF NAME=DYNAMIC_CUSTOM><td><TMPL_IF NAME=BUILD_DYNAMIC><MT_TRANS phrase="Yes"><TMPL_ELSE><MT_TRANS phrase="No"></TMPL_IF></td></TMPL_IF>

That will enable this view for the index templates. For the archive templates, find

<th width="90%"><MT_TRANS phrase="Template Name"></th>

and replace it with

<TMPL_IF NAME=DYNAMIC_CUSTOM><th width="80%"><MT_TRANS phrase="Template Name"></th><th width="10%"><MT_TRANS phrase="Dynamic"></th><TMPL_ELSE><th width="90%"><MT_TRANS phrase="Template Name"></th></TMPL_IF>

Next around six lines down, after a line that looks something similar to

<td><a href="<TMPL_VAR NAME=SCRIPT_URL>?__mode=view&_type=template&id=<TMPL_VAR NAME=ID>&blog_id=<TMPL_VAR NAME=BLOG_ID>"><MT_TRANS phrase="<TMPL_VAR NAME=NAME>"></a></td>

add

<TMPL_IF NAME=DYNAMIC_CUSTOM><td><TMPL_IF NAME=BUILD_DYNAMIC><MT_TRANS phrase="Yes"><TMPL_ELSE><MT_TRANS phrase="No"></TMPL_IF></td></TMPL_IF>

And you're all set. If (and only if) you select the option "Set Each Template's Build Options Separately" a new column will pop up on the Templates listing page that will show you whether or not that template is built dynamically.

I'm also tinkering around with the ability to have a checkbox that is ticked or not instead of Yes and No. This way it becomes a piece of cake to mass edit templates, but the page may start to get crowded...

1 Comments

Mike Wills said:
on Jan 7, 2005 8:04 PM | Reply

I hope this gets added to the core MT application. This looks cool!