컨텐츠 위젯 추출되는 글의 링크 형태를 바꾸고 싶습니다.

아래는 소스의 일부분입니다. 

 

<ul class="eq widget widget-normal">
  {@$_idx=0}
  <!--@foreach($widget_info->content_items as $key => $item)-->
  <li<!--@if($_idx >= $widget_info->list_count)--> style="display:none"<!--@end-->>
    <a href="{$item->getLink()}">
      <!--@foreach($widget_info->option_view_arr as $k => $v)-->
        <!--@if($v=='title')-->

<!--@if($widget_info->show_browser_title=='Y' && $item->getBrowserTitle())-->
          <span class="eq text-xsmall text-primary">{$item->getBrowserTitle()}</span>
          <!--@end-->

 ......

 

상기 소스 중 링크가 걸리는 부분,

 

  <a href="{$item->getLink()}">

 

<a href="{getSiteUrl($item->domain,'','mid',$item->get('mid'),'document_srl','read_review_tab','evaluation')}" >

 

이런식으로 링크를 넣었는데 

 

 https://martmonster.com/seoul/read_review_tab 형식으로 제대로 링크 표시가 되지 않습니다.

 

 https://martmonster.com/index.php?mid=seoul&document_srl=2027 &read_review_tab=evaluation

 

식으로 링크가 걸리게끔 하려면

 

<a href="{getSiteUrl($item->domain,'','mid',$item->get('mid'),'?????','read_review_tab','evaluation')}" >

 

에서 어떻게 추가를 해야 할지 도움 말씀 부탁드리겠습니다.

  • profile
    <a href="{getUrl('','mid',$item->get('mid'),'document_srl',$item->get('document_srl'),'read_review_tab','evaluation')}" > 로 하면 되지 않을까요?
  • profile ?
    답변감사합니다. 말씀해 주신대로 하니 해결이 되었습니다. ^^
  • profile ?

    말씀 해 주신 소스에서 댓글을 추출해서 링크 클릭 시 해당 문서의 댓글로 바로 이동하는 부분을 구현하고자 하는데 이리저리 관련 소스를 뒤져보고 적용을 해보아도 잘 되질 않는데  죄송하지만 한가지만 더 문의드려도 될까요?

     

    {@ $oComment = $oCommentModel->getComment($comment->comment_srl)}


    <a href="{getUrl('','mid',$item->get('mid'),'document_srl',$item->get('document_srl'),'read_review_tab','evaluation')}#comment_{$oComment->get('comment_srl')}"

     

    형태로 시도를 해봤는데 에러가 발생하는데 댓글로 바로 이동하려면 혹시 이 부분에 어떤 걸 적용 해야 할까요?

     

    <a href="{getUrl('','mid',$item->get('mid'),'document_srl',$item->get('document_srl'),'read_review_tab','evaluation')}#comment????"

  • ? profile
    $oComment는 commentItem 관련한 것인 데다, 댓글 번호를 가지고 불러오는 변수여서 안 될 거예요.

    근데 가져올 댓글 번호를 임의로 가져오시는 건가요? 말씀하신 걸로는 댓글번호 추출할 때 어떤 맥락에서 가져온다는 건지 잘 모르겠어요. 그냥 아무 댓글이나 가져오진 않을 테고...

    혹시 컨텐츠 위젯에서 최근 댓글을 출력하는 소스에 관한 질문인가요?
  • profile ?

    제가 질문내용을 상세하게 올리지 못했는데요. ^^;

     

    아래 원래 컨텐츠 위젯 소스에서 최근글 출력 설정을 하고 윤삼님께서 말씀 해 주신 소스를 적용하면

    <ul class="eq widget widget-normal">
      {@$_idx=0}
      <!--@foreach($widget_info->content_items as $key => $item)-->
      <li<!--@if($_idx >= $widget_info->list_count)--> style="display:none"<!--@end-->>
         <a href="{getUrl('','mid',$item->get('mid'),'document_srl',$item->get('document_srl'),'read_review_tab','evaluation')}" > 
          <!--@foreach($widget_info->option_view_arr as $k => $v)-->
            <!--@if($v=='title')-->

    ......

     

    https://martmonster.com/index.php?mid=seoul&document_srl=2027&read_review_tab=evaluation 형태로 최근 글로 이동이 잘 됩니다.

     

    추가로 올린 질문은 위젯 설정에서 최근글이 아닌 최근 댓글로 출력을 설정했을 경우 해당 문서의 댓글로 바로 이동하게끔 하려고 합니다.

    https://martmonster.com/index.php?mid=seoul&document_srl=2027&read_review_tab=evaluation#comment_58175

     

    말씀해 주신 부분에서 #comment_58175 을 추가로 출력되게끔 해주면 되지 않을 까 해서 이러 저래 소스들을 뒤져 보고 있는데 잘 해결이 되지 않아 추가로 질문을 드렸습니다. 

  • ? profile
    $item->getLink()를 안 써서 생기는 문제였군요.

    <a href="{getUrl('','mid',$item->get('mid'),'document_srl',$item->get('document_srl'),'read_review_tab','evaluation')}#comment_{$item->get('comment_srl')}"

    이렇게 해봐도 안 되려나요..
  • profile ?

    윤삼님 감사합니다. 말씀해 주신 부분으로 적용해보니 바로 해결되었습니다.!!
    즐거운 주말보내시구요. 거듭 감사의 말씀드립니다.^^