zero님의 초기위젯인 "웹진형태의 최근게시물보기->공지사항형태 위젯"을 사용하고있습니다.

제목과 본문 내용을 그대로 보여주는 위젯입니다.

 

원본 게시물 작성시 글자를 키워 작성한 게시물을 읽어올때, 위젯에서 글자크기가 그대로 크게 나타나서 조정하고싶습니다.

여기저기 검색 해 보니 getContent() 로 그대로 뿌려줄때는 어쩔 수 없다고하는데 다른방법으로 해결할 방법도 없을까요?

 

아래 코드는 해당 위젯의  list.html 파일입니다

 

<!--// 설정된 컬러셋의 종류에 따라서 css파일을 import 합니다 -->

<!--@if($colorset=="normal"||!$colorset)-->
    <!--%import("css/normal.css")-->
<!--@end-->

<div class="noticeBox">
    <!--@if($widget_info->title)-->
        <h2>{$widget_info->title}</h2>
    <!--@end-->

    <!--@if(count($widget_info->document_list))-->
    <div>
        <table cellspacing="0" class="listTable">
        {@ $count = 0; }
        <!--@for($i=0;$i<$widget_info->rows_list_count;$i++)-->
        <tr valign="top">
            <!--@for($j=0;$j<$widget_info->cols_list_count;$j++)-->
                {@ $oDocument = $widget_info->document_list[$i*$widget_info->cols_list_count + $j]}
                {@ $_existsThumbnail = $oDocument->thumbnailExists($widget_info->thumbnail_width,$widget_info->thumbnail_height,$widget_info->thumbnail_type) }
            <td><!--@if($oDocument->document_srl)-->

                <div class="titleBox">

                    <span class="title">
                        <a href="{$oDocument->getPermanentUrl()}#{$oDocument->getCommentCount()}">{$oDocument->getTitle($widget_info->subject_cut_size)}</a>
                    </span>

                    <!--@if($widget_info->display_regdate == 'Y')-->
                    <span class="regdate">[{$oDocument->getRegdate("m-d")}]</span>
                    <!--@end-->

                </div>

                <div class="contentbox">
                    <!--@if($_existsThumbnail)--><a href="{getUrl('','document_srl',$oDocument->document_srl)}"><img src="{$oDocument->getThumbnail($widget_info->thumbnail_width,$widget_info->thumbnail_height,$widget_info->thumbnail_type)}" border="0" alt="" align="left" class="thumbnail"/></a><!--@end-->
                    {$oDocument->getContent($widget_info->content_cut_size)}
                </div>

            <!--@end--></td>
            <!--@end-->
            <!--@for($k=$j;$k<$widget_info->cols_list_count;$k++)--><td> </td><!--@end-->
        </tr>
        <!--@end-->
        </table>
    <!--@end-->
    </div>

</div>

 

  • profile

    $oDocument가 위젯 자체로 만들어낸 변수가 아니라 documet 모듈에서 가져온 것이라는 전제 하에, 모양새로 보면 $oDocument->get('content')로 바꿔주면 될 것 같은데요.
    오래된 위젯이라니 어떻게 작동하는 것인지는 감이 잘 안 잡히네요.

  • profile profile
    그렇게 해도 역시 글자가 키워진 게시물은 적용이 안되는군요.
    할수없이 줄바꿈 되지않는 summary 를 불러 사용하기로 했습니다.
    아참, summary 로 불러올 경우에 해당 위젯에서만 줄바꿈되게 할 수도 있을까요?
    {nl2br($oDocument->getSummary($widget_info->content_cut_size))}
    이 방법은 안먹히는군요.
    감사합니다.
  • profile profile
    $oDocument 에 정상적으로 documentItem 을 호출하여 클래스를 만들어줫더라면 문제 없습니다.

    하지만 대부분 위젯은 위젯자체의 Item 클래스를 만드는 경우가 있기도 해요. 그래서 해당 항목에 위젯 내의 getContent 항목이 있는지 확인하고 없다면 윤삼님처럼 바꾸시는게 좋지요 :)
  • profile profile
    해당 위젯을 잘 모르니 단정지어 말할 수 없지만, 아마도 getSummary 메소드에서 이미 처리가 돼서 그럴지도 모르겠어요.

    그나저나 코어에 포함된 기본 content 위젯을 쓰지 그러셨어요?
    거기선 (제 기억이 맞다면) $item->get('original_content') 로 본문 그대로 가져올 수 있거든요.
  • profile profile
    원하는 형태로 출력이 되질 않아서요.
    제가 원하는형태는 제목과 게시물내용이 한꺼번에 나오는 것이라서요.
    감사합니다.
  • profile
    구글링하다가 윤삼님의 댓글에서 답을 찾았습니다.
    {nl2br($oDocument->getContentText($widget_info->content_cut_size))}
    이렇게 해결했습니다.
    감사합니다