<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[TNF : Tatter Network Foundation forum - 카테고리를 <head> 태그 안에서 출력하고 싶습니다.]]></title>
	<link rel="self" href="http://forum.tattersite.com/ko/extern.php?action=feed&amp;tid=6660&amp;type=atom"/>
	<updated>2008-09-24T07:59:08Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.tattersite.com/ko/viewtopic.php?id=6660</id>
		<entry>
			<title type="html"><![CDATA[RSS 답글: 카테고리를 <head> 태그 안에서 출력하고 싶습니다.]]></title>
			<link rel="alternate" href="http://forum.tattersite.com/ko/viewtopic.php?pid=30459#p30459"/>
			<content type="html"><![CDATA[<p>사실 이게 쫌 많이 쉬운거였는데요, 미리 봤으면 설명을 드릴 수 있었는데 연구가 바빠서... 죄송합니다.</p><p>스킨에서 지원하는 치환자 중 &lt;s_article&gt; 영역에서 쓸 수 있는 article_rep_category_body_id 라는 치환자가 있습니다. 그걸 스킨에서 사용하면 여러개의 글이 출력될 때도 각 글마다 해당되는 category의 body id로 관리 패널에서 설정한 값을 클래스로 줄 수 있습니다.<br />&lt;div class=&quot;[##_article_rep_category_body_id_##]&quot;&gt; .... &lt;/div&gt; 로 글 출력 부분을 싸 주면 되겠죠? ^^</p>]]></content>
			<author>
				<name><![CDATA[inureyes]]></name>
				<uri>http://forum.tattersite.com/ko/profile.php?id=2</uri>
			</author>
			<updated>2008-09-24T07:59:08Z</updated>
			<id>http://forum.tattersite.com/ko/viewtopic.php?pid=30459#p30459</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[RSS 답글: 카테고리를 <head> 태그 안에서 출력하고 싶습니다.]]></title>
			<link rel="alternate" href="http://forum.tattersite.com/ko/viewtopic.php?pid=30428#p30428"/>
			<content type="html"><![CDATA[<div class="codebox"><pre><code>function getCategoryName($target) {
    global $blogid, $entries;

    //카테고리별 body id를 지정하지 않은 상태에서 엔트리에서 카테고리 추출(단 엔트리가 하나일때)
    $categoryName = getCategoryNameById($blogid, $entries[0][&#039;category&#039;]);

    //관리자 모두 카테고리별 body id를 지정한경우 아래와 같이 추출하거나..(단 엔트리가 하나일때)
    //이경우 별도 지정한  카테고리별 body id를 css에 적용하면 됨. 카테고리에 속한 모든 엔트리는 지정한 것으로 표시됨.
    $categoryName = getCategoryBodyIdById($blogid, $entries[0][&#039;category&#039;]);

    $target = $categoryName;
    return $target;
}</code></pre></div><div class="codebox"><pre><code>&lt;tag name=&quot;CategoryName&quot; handler=&quot;getCategoryName&quot; /&gt;

&lt;body id=&quot;[##_body_id_##]_[##_CategoryName_##]&quot;&gt;</code></pre></div><p>위와 같이 하시면 될듯 합니다. <br />플러그인을 사용하지 않으셔도 &#039;관리자/글관리/분류설정&#039;에서 각 카테고리별 body id를 지정 하셔서 지정한 id를 css에서 참조하시면 훨씬 수월합니다.</p><p>참조 : /model/blog.category.php</p>]]></content>
			<author>
				<name><![CDATA[jparker]]></name>
				<uri>http://forum.tattersite.com/ko/profile.php?id=10</uri>
			</author>
			<updated>2008-09-23T00:42:40Z</updated>
			<id>http://forum.tattersite.com/ko/viewtopic.php?pid=30428#p30428</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[RSS 답글: 카테고리를 <head> 태그 안에서 출력하고 싶습니다.]]></title>
			<link rel="alternate" href="http://forum.tattersite.com/ko/viewtopic.php?pid=30427#p30427"/>
			<content type="html"><![CDATA[<p>아, 결국 스스로 해결 했습니다. ㅡ.ㅡ</p>]]></content>
			<author>
				<name><![CDATA[김동식]]></name>
			</author>
			<updated>2008-09-23T00:24:47Z</updated>
			<id>http://forum.tattersite.com/ko/viewtopic.php?pid=30427#p30427</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[RSS 답글: 카테고리를 <head> 태그 안에서 출력하고 싶습니다.]]></title>
			<link rel="alternate" href="http://forum.tattersite.com/ko/viewtopic.php?pid=30425#p30425"/>
			<content type="html"><![CDATA[<p>위 댓글에 잘못 된 부분이 있어서 덧붙입니다.</p><p>-index.php<br /></p><div class="codebox"><pre><code>$blunzl_sql = &quot;SELECT category FROM tc_Entries WHERE id = {$mother}&quot;;

이 아니라

$blunzl_sql = &quot;SELECT category FROM {$database[&#039;prefix&#039;]}Entries WHERE id = {$mother}&quot;;

였습니다.</code></pre></div>]]></content>
			<author>
				<name><![CDATA[김동식]]></name>
			</author>
			<updated>2008-09-22T18:13:28Z</updated>
			<id>http://forum.tattersite.com/ko/viewtopic.php?pid=30425#p30425</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[RSS 답글: 카테고리를 <head> 태그 안에서 출력하고 싶습니다.]]></title>
			<link rel="alternate" href="http://forum.tattersite.com/ko/viewtopic.php?pid=30424#p30424"/>
			<content type="html"><![CDATA[<p>친절한 답변 감사드립니다. ^^</p><p>하지만 여전히 같은 문제에 부딪히는 것 같습니다.<br />첫 질문에서 제가 너무 설명이 부족한 것 같아서 덧붙여 봅니다.</p><p>예를 들어 블로그에 A, B, C라는 카테고리가 있다고 가정하겠습니다.<br />그리고 블로그는 현재 페이지 당 1개의 글을 출력하도록 설정되어 있다고 하겠습니다.<br />여기서 제가 구현하고자 하는 것은 현재 출력 된 글의 카테고리에 따라 디자인이 바뀌도록 하고자 함입니다.</p><p>물론 notice, tag, search, location, guestbook 등은<br />특정 카테고리를 포함하고 있지 않기 때문에<br />body id를 사용하여 각각의 디자인을 적용시키기가 용이할 것입니다.</p><p>그러나 page, entry와 같은 경우 A, B, C라는 모든 카테고리의 글이 출력 가능하기 때문에<br />body id를 사용하여 각 카테고리 별 디자인을 구성하기가 힘듭니다.</p><p>다시 말하자면,<br />A 카테고리의 글과, B 카테고리의 글, 그리고 C 카테고리의 글 각각에 어울리는 디자인을 적용시키고 싶지만<br />대부분 해당 글들의 body id가 보통 page, entry로 정해져 있어서 그렇게 하지 못하고 있습니다.</p><p>결국 제가 바라는 점은 바로 tt-body-page 뒤로 현재 출력 된 글의 카테고리 명이 덧붙여 졌으면 하는 것입니다.</p><p>예를 들어 #tt-body-page-A 또는 #tt-body-entry-B 이런식으로 말이죠.</p><p>텍스트 큐브 이전에는 아래와 같은 플러그인을 만들어서 그것을 구현했었습니다.</p><p>-index.php<br /></p><div class="codebox"><pre><code>function GetCurrentCategory($mother, $target) {
    global $database, $view;
    $blunzl_sql = &quot;SELECT category FROM tc_Entries WHERE id = {$mother}&quot;;
    $blunzl_result = mysql_query($blunzl_sql);
    $blunzl_category = mysql_fetch_array($blunzl_result);
    $blunzl_category = $blunzl_category[&#039;category&#039;];
    if($blunzl_category==1)
    {$blunzl_category=&quot;-A&quot;;}
    elseif($blunzl_category==2)
    {$blunzl_category=&quot;-B&quot;;}
    elseif($blunzl_category==3)
    {$blunzl_category=&quot;-C&quot;;}
    elseif($blunzl_category==4)
    {$blunzl_category=&quot;-D&quot;;}
    else{$blunzl_category=&quot;&quot;;}

    $view=str_replace(&quot;[##_blunzl_category_##]&quot;,$blunzl_category,$view);
    return $target;
}</code></pre></div><p>-index.xml<br /></p><div class="codebox"><pre><code>(생략)
&lt;binding&gt;
    &lt;listener event=&quot;ViewPostContent&quot; handler=&quot;GetCurrentCategory&quot; /&gt;
&lt;/binding&gt;</code></pre></div><p>-skin.html<br /></p><div class="codebox"><pre><code>(생략)
&lt;body id=&quot;[##_body_id_##][##_blunzl_category_##]&quot;&gt;</code></pre></div><p>하지만 지금의 텍스트 큐브에서는 위의 플러그인이 동작하지 않는 것 같습니다.<br />플러그인 자체도 기존의 플러그인에서 약간의 수정을 가한 것이라 어디를 고쳐야 할지 잘 모르겠습니다.</p><p>어떻게 하면 현재 출력된 글의 카테고리 값을 바로 가져올 수 있을까요?</p>]]></content>
			<author>
				<name><![CDATA[김동식]]></name>
			</author>
			<updated>2008-09-22T18:07:30Z</updated>
			<id>http://forum.tattersite.com/ko/viewtopic.php?pid=30424#p30424</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[RSS 답글: 카테고리를 <head> 태그 안에서 출력하고 싶습니다.]]></title>
			<link rel="alternate" href="http://forum.tattersite.com/ko/viewtopic.php?pid=30405#p30405"/>
			<content type="html"><![CDATA[<p>보통 각 페이지별 스타일 변경하시려면 skin.html에서 &lt;body id=&quot;[##_body_id_##]&quot;&gt;로 입력하여<br />스타일에서 각 페이지의 body id별로 조정하시는 방법을 사용합니다.<br /></p><div class="quotebox"><blockquote><p>#tt-body-page&nbsp; &nbsp; &nbsp; &nbsp; <br />#tt-body-cover&nbsp; &nbsp; &nbsp; &nbsp; <br />#tt-body-notice&nbsp; &nbsp; &nbsp; &nbsp; <br />#tt-body-entry&nbsp; &nbsp; &nbsp; &nbsp; <br />#tt-body-category&nbsp; &nbsp; *관리자 분류(카테고리)에서 각각 수정 가능<br />#tt-body-tag&nbsp; &nbsp; &nbsp; &nbsp; <br />#tt-body-search&nbsp; &nbsp; &nbsp; &nbsp; <br />#tt-body-archive&nbsp; &nbsp; <br />#tt-body-location&nbsp; &nbsp; <br />#tt-body-guestbook&nbsp; &nbsp; <br />#tt-body-keylog</p></blockquote></div><p>위처럼 body의 id 값을 css에서 정하여 레이아웃을 변경하는 방법입니다. 이건 전체를 바꾸려면 <br />코드가 많이 들어가니, 페이지별 약간 변경시 애용하시면 됩니다.</p><p>플러그인을 이용하여 조정하시려면, (기본 플러그인 구조는 타 플러그인 참조)<br />-index.xml<br /></p><div class="codebox"><pre><code>&lt;tag name=&quot;SKIN_head_end&quot; handler=&quot;getCssSelect&quot; /&gt;</code></pre></div><p>위 핸들러(함수명) getCssSelect를 이용하여</p><p>-index.php<br /></p><div class="codebox"><pre><code>function getCssSelect($target) {
    global $suri, $skinSetting, $serviceURL;
    $skinPath = $serviceURL . &#039;/skin/&#039; . $skinSetting[&#039;skin&#039;];
    $css = &#039;&#039;;
    if ($suri[&#039;directive&#039;] == &#039;/category&#039;) {
        $css = &#039;&lt;link rel=&quot;stylesheet&quot; media=&quot;screen&quot; type=&quot;text/css&quot; href=&quot;&#039; . $skinPath . &#039;/style-1.css&quot; /&gt;&#039;;
    }else if ($suri[&#039;directive&#039;] == &#039;/search&#039;) {
        $css = &#039;&lt;link rel=&quot;stylesheet&quot; media=&quot;screen&quot; type=&quot;text/css&quot; href=&quot;&#039; . $skinPath . &#039;/style-2.css&quot; /&gt;&#039;;    
    }
    $target = $css;
    return $target;
}</code></pre></div><p>위와 같이 page directive값을 인식하여 별도로 &lt;head&gt;하단에 출력해줄수도 있습니다.</p>]]></content>
			<author>
				<name><![CDATA[jparker]]></name>
				<uri>http://forum.tattersite.com/ko/profile.php?id=10</uri>
			</author>
			<updated>2008-09-22T13:34:34Z</updated>
			<id>http://forum.tattersite.com/ko/viewtopic.php?pid=30405#p30405</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[카테고리를 <head> 태그 안에서 출력하고 싶습니다.]]></title>
			<link rel="alternate" href="http://forum.tattersite.com/ko/viewtopic.php?pid=30404#p30404"/>
			<content type="html"><![CDATA[<p>카테고리별로 스킨 디자인이 바뀌도록 블로그를 꾸미려고 합니다.</p><p>그런데 그렇게 하려면 아무래도 카테고리에 맞는 스타일시트를 불러들여야 하는데</p><p>&lt;head&gt; 태그 안에서 현재 글의 카테고리를 뿌려주는 방법을 잘 모르겠습니다.</p><p>참고 할 만한 플러그인이나 접근 방법에 대해서 알려주셨으면 합니다.</p>]]></content>
			<author>
				<name><![CDATA[김동식]]></name>
			</author>
			<updated>2008-09-22T12:51:51Z</updated>
			<id>http://forum.tattersite.com/ko/viewtopic.php?pid=30404#p30404</id>
		</entry>
</feed>
