Strict Standards: Non-static method Soojung::addReferer() should not be called statically in /home/lifthrasiir/sites/sapzil.info/soojung/settings.php on line 79

Warning: Cannot modify header information - headers already sent by (output started at /home/lifthrasiir/sites/sapzil.info/soojung/settings.php:79) in /home/lifthrasiir/sites/sapzil.info/soojung/classes/Counter.class.php on line 63

Strict Standards: Non-static method Entry::getEntry() should not be called statically in /home/lifthrasiir/sites/sapzil.info/soojung/entry.php on line 51

Strict Standards: Non-static method Soojung::entryIdToFilename() should not be called statically in /home/lifthrasiir/sites/sapzil.info/soojung/classes/Entry.class.php on line 182

Strict Standards: Non-static method Soojung::queryFilenameMatch() should not be called statically in /home/lifthrasiir/sites/sapzil.info/soojung/classes/Soojung.class.php on line 55
TokigunStudio3 | 블로그: soojung 템플릿 수정 2탄-_-;;;

내용으로 바로 넘어 가기


TokigunStudio3

228 / 3282   


더 이상 이 블로그는 운영되지 않습니다. 새 블로그로 가 주세요.

soojung 템플릿 수정 2탄-_-;;;

2004/09/30 PM 12:46 | 개발/soojung | 3 comments | 0 trackbacks | AllBlog: vote, to pocket

0.2.2로 업데이트하니 옆의 사이드바가 너무 길어져서 자바스크립트를 사용하도록 수정(...)했다. 물론 현재 soojung 쓰시는 분들께서는 충분히 고치시겠지만 혹시나 모르실 분을 위해서... (모든 파일들은 [soojung 디렉토리]/templates/default에 있다.)

1. 자바스크립트 추가
header.tpl의 head 태그 끄트머리에 다음 코드를 삽입한다. MSIE4에서 안 돌아가는데 그건 귀찮아서 생략했고 혹시나 필요하신 분은 document.getElementById 대신 여길 참고해서 GetObject 함수를 쓰면 된다. (x library를 쓰던지)

<script type="text/javascript">/*<![CDATA[*/{literal}
function fold_sidebar(objid) {
document.getElementById(objid).className =
(document.getElementById(objid).className ? '' : 'div_hide');
return false;
}
{/literal}/*]]>*/</script>

2. 스타일 수정
styles.css의 적당한 위치({와 } 사이엔 넣지 말고... ;;)에 다음을 삽입한다. 색깔은 자기 좋아하는 걸로 고쳐도 상관 없다. (사실은 어떻게 고쳐도 상관 없다. ;;; div_hide만 빼고...)

#sidebar h3 a { color: #999; }
#sidebar h3 a:hover { color: #000; }
#sidebar .div_hide { display: none; }

3. HTML 태그 수정
footer.tpl엘 보면 다음과 같은 부분이 수도 없이 많이 있을 것이다. (search는 ul이 아니라 form으로 시작한다. 그건 알아서 확인하시고...)

<h3>Menu</h3>
<ul>
<li><a href="{$baseurl}/index.php">main</a></li>
<li><a href="{$baseurl}/admin.php">admin</a></li>
</ul>

이것들을 모조리 다음과 같이 고쳐라! (고치거나 추가된 부분은 밑줄쳐 놓았다.)

<h3><a href="#none" onclick="return fold_sidebar('div_menu');">Menu</a></h3>
<ul id="div_menu">
<li><a href="{$baseurl}/index.php">main</a></li>
<li><a href="{$baseurl}/admin.php">admin</a></li>
</ul>

주의할 점은 위에 굵게 표시한 부분은 같은 메뉴 안에서 똑같아야 한다는 것이다. (안 그러면 메뉴를 눌렀을 때 엉뚱한 메뉴가 접힐 수 있다-_-) 그리고 다른 메뉴 사이에서는 모두 달라야 한다. 자세한 건 본인 블로그 HTML 소스를 참고하면 될 것이다.

4. 처음에 접혀 있는 메뉴 만들기
별로 안 쓰는 메뉴(recent trackback 같은)는 처음에 접혀 있는 게 좋을 것이다. 이 경우 해당 메뉴의 ul(혹은 form 등) 태그에서 다음을 추가하면 된다. (밑줄 친 부분을 추가)

<ul id="div_menu" class="div_hide">

자! 이렇게 하면 완성이다. :) 잘 써보세~ (뭐냐. 강좌냐?;;)

TrackBack URL: http://sapzil.info/soojung/trackback.php?blogid=45

Comment: 디토 (2004/09/30 PM 03:10)

if (document.all && !document.getElementById) {
document.getElementById = function (id) {
return document.all[id];
}
}

IE4에서는 이렇게 하면 안되려나요;

Comment: 토끼군 (2004/09/30 PM 03:59)

디토: 아! 그렇게 해도 될 듯 하군요. 오오 좋은 팁 하나 구했... (..-_-;;;)

Comment: ddt (2004/09/30 PM 08:50)

cvs에 커밋 완료~ :)

Copyright (c) 1995-2005, Kang Seonghoon (Tokigun).