메뉴 건너뛰기


아이콘

XE3 게시판 페이지 갯수 지정하기

관리자 페이지 - 테마 디자인 - 테마 에디터 -  해당 테마 선택후,  편집창 제일 하단에 입력

Cosmo 테마 - theme.blade.php

DevRyan Theme - _setup-custom.blade.php

Together 테마 -  _header.blade.php

 

<script>
document.addEventListener("DOMContentLoaded", function() {
    // 활성화된(현재) 페이지 번호 위치를 찾아서 동적으로 5개만 남기고 나머지를 숨기는 로직
    var items = document.querySelectorAll('.xe-list-board--pagination-pc .xe-list-board__pagination-number');
    if(items.length > 5) {
        var activeIndex = -1;
        items.forEach(function(item, idx) {
            if(item.classList.contains('xe-list-board__pagination-number--active')) {
                activeIndex = idx;
            }
        });
        
        // 현재 페이지가 중심에 오도록 시작점과 끝점 계산 (최대 5개 유지)
        var start = Math.max(0, activeIndex - 2);
        var end = Math.min(items.length - 1, start + 4);
        if(end - start < 4) start = Math.max(0, end - 4);
        
        items.forEach(function(item, idx) {
            if(idx < start || idx > end) {
                item.style.setProperty('display', 'none', 'important');
            }
        });
    }
});
</script>