Howto: Add “Add Attachment” – functionality to a MOSS2007 Blog (Comments)

obwohl in den advanced settings der comments list die option “Attachments to list items are:” per default enabled sind, steht die funktionalität trotzdem nicht zur verfügung; es ist allerdings ganz einfach, dies trotzdem zu aktivieren:

man öffnet einen post und wechselt dann in den edit mode dieser seite:
Edit Page

zwischen dem “comments” und dem “new comments” webpart fügt man ein “conent editor webpart” hinzu und editiert dann dessen settings:
Add a Content Editor Webpart

als title vergibt man z.b. “Add Attachments”, in den source editor fügt man nachfolgenden html code ein:
Configure Content Editor Webpart

<table class="ms-toolbar" cellpadding="2" cellspacing="0" border="0" id="ctl00_m_g_4e9517cc_cbfa_4ac0_b45a_4f1f64696c60_ctl00_ctl01_ctl00_toolBarTbl" width="100%" >
 <tr>
  <td class="ms-toolbar" nowrap="true">
   <table cellpadding='1' cellspacing='0'>
    <tr>
     <td class='ms-toolbar' nowrap>
      <a href="javascript:UploadAttachment()" onclick="javascript:UploadAttachment();" accesskey="I" title="Add a Attachment" class='ms-toolbar'>
       <img align='absmiddle' alt="Add a Attachment" src="/_layouts/images/attachtb.gif" style='border-width:0px;' width='16' height='16'>
      </a>
     </td>
     <td class='ms-toolbar' nowrap>
      <a id="ctl00_m_g_4e9517cc_cbfa_4ac0_b45a_4f1f64696c60_ctl00_ctl01_ctl00_toolBarTbl_RptControls_diidIOAttach" style="visibility:hidden;" href="javascript:UploadAttachment()">
      </a>
      <a href="javascript:UploadAttachment()" onclick="javascript:UploadAttachment();" accesskey="I" id="ctl00_m_g_4e9517cc_cbfa_4ac0_b45a_4f1f64696c60_ctl00_ctl01_ctl00_toolBarTbl_RptControls_diidIOAttach_LinkText" class='ms-toolbar'>Add a Attachment</a>
     </td>
    </tr>
   </table>
  </td> 
  <td width="99%" class="ms-toolbar" nowrap><IMG SRC="/_layouts/images/blank.gif" width=1 height=18 alt="">
  </td> 
 </tr>
</table>

das war es schon! ab sofort können zu den comments attachments hinzugefügt werden!
you are done!

3 thoughts on “Howto: Add “Add Attachment” – functionality to a MOSS2007 Blog (Comments)”

  1. Hi Guys

    Thanks for the info about the “Add Attachment” – it helped solve a big problem. I now however have another problem – How do I view the attachment without having to go into “Edit Item”??
    I need users to be able to post comments and add attachments to their comments and other users must be able to click on the attachment and it must then open the attached file.

    Regards
    Wim.

Comments are closed.