문하우스 게시판의 댓글부분과 댓글입력부분에 토글기능(접고/펴기)을 적용하는 방법입니다.
1. ./modules/board/skins/moonhouse_board/view_document.html 198줄 부터 마지막까지 수정
<!--// 댓글 펼쳐 보일지 지정 -->
<!--@if($module_info->display_comment_box == 'N')-->
{@ $__display_comment = 'active'}
<!--@else-->
<!--@end-->
<!--// 댓글 -->
<!--@if($grant->write_comment && $oDocument->allowComment()) -->
<div class="replyCount">
<a href="#" onclick="jQuery('#commentLayout').toggleClass('active'); return false;" class="button {$btn_class}">
<span>{$lang->comment} [{$oDocument->getCommentcount()}]</span>
</a>
</div>
<!--@end-->
<a name="comment"></a>
<div id="commentLayout" class="commentToggleLayout {$__display_comment}">
<!--#include("./comment.html")-->
<!-- 댓글 입력 폼 -->
<!--@if($grant->write_comment && $oDocument->isEnableComment() )-->
<form action="/" method="post" onsubmit="return procFilter(this, insert_comment)" class="boardEditor" >
<input type="hidden" name="mid" value="{$mid}" />
<input type="hidden" name="document_srl" value="{$oDocument->document_srl}" />
<input type="hidden" name="comment_srl" value="" />
<input type="hidden" name="content" value="" />
<div class="boardWrite commentEditor">
<div class="userNameAndPw">
<!--@if(!$is_logged)-->
<label for="userName">{$lang->writer}</label>
<input type="text" name="nick_name" value="" class="userName inputTypeText" id="userName"/>
<label for="userPw">{$lang->password}</label>
<input type="password" name="password" value="" id="userPw" class="userPw inputTypeText" />
<label for="emailAddress">{$lang->email_address}</label>
<input type="text" name="email_address" value="" id="emailAddress" class="emailAddress inputTypeText"/>
<label for="homePage">{$lang->homepage}</label>
<input type="text" name="homepage" value="" id="homePage" class="homePage inputTypeText"/>
<!--@else-->
<input type="checkbox" name="notify_message" value="Y" id="notify_message" />
<label for="notify_message">{$lang->notify}</label>
<!--@end-->
<secret=="Y'>!--@if($module_info->secret=="Y")-->
<input type="checkbox" name="is_secret" value="Y" id="is_secret" />
<label for="is_secret">{$lang->secret}</label>
<!--@end-->
</div>
<div class="editor">{$oDocument->getCommentEditor()}</div>
</div>
<div class="commentButton tRight">
<span class="button {$btn_class}"><input type="submit" value="{$lang->cmd_comment_registration}" accesskey="s" /></span>
</div>
</form>
<!--@end-->
</div>
2. ./modules/board/skins/moonhouse_board/skin.xml 에 추가
<var name="display_comment_box" type="select" default="Y">
<title xml:lang="ko">코멘트박스 접기</title>
<options value="Y">
<title xml:lang="ko">펴기</title>
</options>
<options value="N">
<title xml:lang="ko">접기</title>
</options>
<description xml:lang="ko">코멘트박스가 자동으로 펼쳐 보일지 지정할 수 있습니다.</description>
</var>
3. ./modules/board/skins/moonhouse_board/css/common.css 에 추가
.commentToggleLayout{ text-align:left;display:block; position:relative;}
.commentToggleLayout.active{ display:none;}