Xing 4 TWiki

Function: RenderGuestBookEntry

Function that helps to render a guestbook entry

Documentation

This TopicFunction consists of two parts where one is the head and one is the footer of a guestbook. So the guestbooks are released from extensive markup and only hold the two calls for each entry to this function surrounding the actual comment.

Css
  • empGuestBookReply
  • empGuestBookReply<n> where <n> is the number of the reply
  • empGuestBookReplyInfo
  • empGuestBookReplyHeadline
  • empGuestBookTime
  • empGuestBookReplyText

Implementation

Dummy default section

%STARTINCLUDE%
~~~
%~~ DBCALL{"RenderGuestBookEntry" section="header" SOURCE="%SOURCE%" HEADLINE="%HEADLINE%" DATE="%DATE%"}%
~~~ this is a test entry
%~~ DBCALL{"RenderGuestBookEntry" section="footer"}%
~~~
%STOPINCLUDE%

Header section

Parameter

  • SOURCE
  • HEADLINE
  • DATE
%STARTSECTION{"header"}% <!-- comment header -->
<div class="empGuestBookReply empGuestBookReply%CALC{"$IF($ODD($GET(counter)),Odd,Even)"}%">
  <table cellspacing="0" cellpadding="0">
  <tr>
    <td class="empGuestBookReplyInfo" rowspan="2">
      %DBCALL{"Applications.EmployeePortalApp.RenderGuestBookInfo" SOURCE="%SOURCE%"}%
    </td>
    <td class="empGuestBookReplyHeadline">
      <h3>%CALC{"$SETM(counter, +1)$GET(counter)"}%. %HEADLINE%</h3>
      <span class="empGuestBookTime">%DATE%</span>
    </td>
  </tr><tr>
    <td class="empGuestBookReplyText">
<!-- /comment header ---> 
%ENDSECTION{"header"}%

Footer section

%STARTSECTION{"footer"}% <!-- comment footer -->
    </td>
  </tr>
  </table>
</div>
<script type="text/javascript">
  var elem = document.getElementById('empGuestBookCounter');
  elem.innerHTML = %CALC{"$IF($GET(counter),$GET(counter),0)"}%;
</script>
<!-- /comment footer ---> %ENDSECTION{"footer"}%

Test

1. This is foo bar

22 May 2012 - 01:51
this is a test entry

Calls to 'RenderGuestBookEntry'

Copyright

© 2007 Michael Daum http://wikiring.de

This file is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. For more details read the LICENSE.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, to the extent permitted by law; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Applications.ApplicationTopic
TopicType: DocuTopic, TopicFunction
Summary: Function that helps to render a guestbook entry
TWikiApplication: EmployeePortalApp
r0 - 03 May 2007 - 11:45:50 - TWikiContributor
© giant orange extension cord that reeks hip-hop, funk & soul