안녕하세요?

 

스케치북의 웹진 스타일 리스트 화면에서

아래 이미지처럼 해당 게시물에 달린 댓글 1개를 본문 요약 화면 밑에 보여주고 싶은데요.

혹시 xe에도 댓글 추출 코드라는 게 있을까요?

 

 

제목 없음-1.jpg

TAG •
  • profile

    리스트에서 첫 번째 댓글만 뽑아온다면 이런 식이면 될 것 같은데요.

    <!--// 댓글 불러오기 -->
    <div loop="array_values($document->getComments())=>$key,$comment)" cond="$document->getComments() && $key==0">
        <span>한줄토크</span>
        <span cond="$comment->isSecret()">"비밀글입니다."</span>
        <span cond="!$comment->isSecret()"{cut_str(strip_tags($comment->content),200,'...')}</span>
    </div>

    제가 하고 있는 걸 응용한 거여서 발코딩일 수 있어요;;

  • profile profile
    안녕하세요? 윤삼님...
    우선 답변 주셔서 감사합니다.
    알려주신 코드를 삽입했는데 아래와 같은 오류가 뜹니다.
    Error Parsing Template - syntax error, unexpected ')' in template file modules/board/skins/sketchbook5/_list_webzine.html
  • profile profile

    앗, 죄송해요. 급하게 치느라고요;;;

    <!--// 댓글 불러오기 -->
    <div loop="array_values($document->getComments())=>$key,$comment" cond="$document->getComments() && $key==0">
        <span>한줄토크</span>
       
    <span cond="$comment->isSecret()">"비밀글입니다."</span>
       
    <span cond="!$comment->isSecret()">{cut_str(strip_tags($comment->content),200,'...')}</span>
    </div>

    반복문에서 )를 넣고 span에선 >를 빼먹었었네요. 혼란 드려서 죄송해요;;

  • profile profile
    감사합니다. 윤삼님~~
    늦은 시간까지 답변 달아주시고...
    큰 도움이 되었습니다.
  • profile profile
    아무리 늦더라도 출석은 해야죠ㅋㅋㅋ