Feedback during Power Editing
Many people have asked me how to display the status of comments and trackbacks on the power edit entries screen. This hack will guide you through the process of adding two fields, as shown by the screenshot. One is a drop down menu for the comment status while the other is a checkbox for Trackback status.
First of all, open up lib/MT/App/CMS.pm and around line 2584 find
my $row = $obj->column_values;
and add underneath it
my $row = $obj->column_values;
$row->{"allow_comments_" . $obj->allow_comments} = 1;
Next, around line 2688 find
my $row = $obj->column_values;
$row->{"allow_comments_" . $obj->allow_comments} = 1;
$entry->title(scalar $q->param('title_' . $id));
and add underneath it
my $row = $obj->column_values;
$row->{"allow_comments_" . $obj->allow_comments} = 1;
$entry->title(scalar $q->param('title_' . $id));
$entry->allow_comments($q->param('allow_comments_' . $id));
my $allow_pings = $q->param('allow_pings_' . $id) || '0';
$entry->allow_pings($allow_pings);
Save and close CMS.pm and open up tmpl/cms/list_entry.tmpl. First of all, replace width=755 with width=925. This prevents horizontal scroll in the popup window. Next, find
my $row = $obj->column_values;
$row->{"allow_comments_" . $obj->allow_comments} = 1;
$entry->title(scalar $q->param('title_' . $id));
$entry->allow_comments($q->param('allow_comments_' . $id));
my $allow_pings = $q->param('allow_pings_' . $id) || '0';
$entry->allow_pings($allow_pings);
<th width="10%"><MT_TRANS phrase="Status"></th>
and add underneath it
my $row = $obj->column_values;
$row->{"allow_comments_" . $obj->allow_comments} = 1;
$entry->title(scalar $q->param('title_' . $id));
$entry->allow_comments($q->param('allow_comments_' . $id));
my $allow_pings = $q->param('allow_pings_' . $id) || '0';
$entry->allow_pings($allow_pings);
<th width="10%"><MT_TRANS phrase="Status"></th>
<TMPL_IF NAME=IS_POWER_EDIT>
<th width="10%"><MT_TRANS phrase="Comments"></th>
<th width="10%"><MT_TRANS phrase="Pings"></th>
</TMPL_IF>
Next, find
my $row = $obj->column_values;
$row->{"allow_comments_" . $obj->allow_comments} = 1;
$entry->title(scalar $q->param('title_' . $id));
$entry->allow_comments($q->param('allow_comments_' . $id));
my $allow_pings = $q->param('allow_pings_' . $id) || '0';
$entry->allow_pings($allow_pings);
<th width="10%"><MT_TRANS phrase="Status"></th>
<TMPL_IF NAME=IS_POWER_EDIT>
<th width="10%"><MT_TRANS phrase="Comments"></th>
<th width="10%"><MT_TRANS phrase="Pings"></th>
</TMPL_IF>
<td><TMPL_IF NAME=HAS_EDIT_ACCESS><input type="checkbox" name="id" value="<TMPL_VAR NAME=ID>" /></TMPL_IF></td>
and add directly above it, the following
my $row = $obj->column_values;
$row->{"allow_comments_" . $obj->allow_comments} = 1;
$entry->title(scalar $q->param('title_' . $id));
$entry->allow_comments($q->param('allow_comments_' . $id));
my $allow_pings = $q->param('allow_pings_' . $id) || '0';
$entry->allow_pings($allow_pings);
<th width="10%"><MT_TRANS phrase="Status"></th>
<TMPL_IF NAME=IS_POWER_EDIT>
<th width="10%"><MT_TRANS phrase="Comments"></th>
<th width="10%"><MT_TRANS phrase="Pings"></th>
</TMPL_IF>
<td><TMPL_IF NAME=HAS_EDIT_ACCESS><input type="checkbox" name="id" value="<TMPL_VAR NAME=ID>" /></TMPL_IF></td>
<TMPL_IF NAME=IS_POWER_EDIT>
<td>
<select name="allow_comments_<TMPL_VAR NAME=ID>">
<option value="0"<TMPL_IF NAME=ALLOW_COMMENTS_0> selected="selected"</TMPL_IF>><MT_TRANS phrase="None"></option>
<option value="1"<TMPL_IF NAME=ALLOW_COMMENTS_1> selected="selected"</TMPL_IF>><MT_TRANS phrase="Open"></option>
<option value="2"<TMPL_IF NAME=ALLOW_COMMENTS_2> selected="selected"</TMPL_IF>><MT_TRANS phrase="Closed"></option>
</select>
</td>
<td><input type="checkbox" name="allow_pings_<TMPL_VAR NAME=ID>" value="1"<TMPL_IF NAME="ALLOW_PINGS"> checked="checked"</TMPL_IF> /></td>
</TMPL_IF>
Save list_entry.tmpl and upload both files and you should be done!


Joerg Petermann said:
on Jul 9, 2005 9:39 AM | Reply
Thanks for your work, Arvind. Glad to read your usability hacks. Hope MT will include a lot of the hacks in next versions of Movable Type. All MT-User would be glad. PS: Why you don't have any trackbacks?
Arvind Satyanarayan said:
on Jul 9, 2005 10:14 AM | Reply
Hi Joerg, glad you liked the hack. I've disabled Trackbacks for two reasons:
1) Too much spam, it became more of a burden than a tool that helped me - I now track mentions of Movalog using Technorati's watchlists
2) Broken links, trackbacks from my earlier entries now mostly point to broken links.
prolurkr said:
on Sep 1, 2005 9:09 PM | Reply
I'm not finding any of the statements you say to look for in tmpl/cms/list_entry.tmpl. Is there somewhere else I should look? I upgraded to 3.2 last weekend.
Mike Haddad said:
on Sep 7, 2005 11:56 PM | Reply
prolurkr, I can only assume that they changed the setup when they upgraded to 3.2. I sent out an email trying to verify this but haven't got a response yet. Right now my guess is that this is going to need to be rewritten for Movable Type 3.2, which is a shame because I was looking forward to opening up my Trackbacks again after they upgraded the spam protection.