굉장히 오랜 시간 많은 삽질을 했지만 결국 성공했습니다. -_-)v

{@$i=0;}
{@
$wdg[0] = $set->wdg_random0;
$wdg[1] = $set->wdg_random1;
$wdg[2] = $set->wdg_random2;
$wdg[3] = $set->wdg_random3;
}

먼저 루프문 앞에 반복될 변수를 배열로 만들어줍니다. 결국 이 방법이 기본이고 젤 간단한 거 같아요.

<li loop="$main_menu->list => $key1, $val1" class="depth1" cond="$val1['list']">
    <a href="{$val1['href']}" class="on"|cond="$val1['selected']" target="_blank"|cond="$val1['open_window'] == 'Y'">{$val1['link']}</a>
    <div class="gnb_sub_wrap">
        <dl class="gnb_sub" cond="$val1['list']">
            <dt>{$val1['link']} <i class="xi-angle-right"></i></dt>
            <dd loop="$val1['list'] => $key2, $val2" class="depth2 <!--@if($val2['list'])-->more<!--@end-->">
                <a href="{$val2['href']}" target="_blank"|cond="$val2['open_window'] == 'Y'">{$val2['link']}</a>
            </dd>
        </dl>

        <div class="wdg_random">{$wdg[$i]}
        </div>
    </div>
{@$i++;}
</li>

그리고 이렇게 loop 되는 메뉴 안에 변수를 배열 출력하도록 작성하고 끝냅니다. :)

이온디

profile
이온디는 라이믹스를 비롯한 다양한 CMS의 시드뱅크를 꿈꿉니다. 여러분들이 사랑하는 웹소스를 언제든지 사용할 수 있게 하기 위해 이온디는 매일 소스코드를 유지보수하고 있으며, 언제든지 다운로드할 수 있는 소스마켓을 운영하고 있습니다.

#XE마켓 - 이온디스토어
https://eond.com/xemarket/

# XE/라이믹스 단톡방을 운영 중입니다. (비번: 2022)
https://open.kakao.com/o/giaKKnl

# XE/라이믹스 생활코딩 모듈 강좌입니다.
https://opentutorials.org/module/3774
  • ?
    한 수 배우고 갑니다
  • profile
    두 수 배우고 갑니다
  • profile profile
    정작 본인은 까먹었군요. -_-a;;;; 뭔지 기억이 안 납니다. ㅠ;