Шаблон:КатегорияDPL: различия между версиями
Shihov (обсуждение | вклад) Нет описания правки |
Shihov (обсуждение | вклад) Нет описания правки |
||
Строка 1: | Строка 1: | ||
<div id="section-header" style="font-weight: bold;">Разделы</div> | |||
<ul id="sections-list"> | |||
{{#tag:DynamicPageList| | |||
category={{{1|}}} | category={{{1|}}} | ||
namespace=Category | namespace=Category | ||
Строка 7: | Строка 9: | ||
order=ascending | order=ascending | ||
suppresserrors=true | suppresserrors=true | ||
noresultsheader= | noresultsheader= | ||
}} | }} | ||
</ul> | |||
<div style="font-weight: bold;">Страницы</div> | |||
<ul> | |||
{{#tag:DynamicPageList| | {{#tag:DynamicPageList| | ||
category={{{1|}}} | category={{{1|}}} | ||
namespace= | namespace=! | ||
mode=unordered | mode=unordered | ||
ordermethod=sortkey | ordermethod=sortkey | ||
order=ascending | order=ascending | ||
suppresserrors=true | suppresserrors=true | ||
resultsheader=<div style="font-weight: bold; margin-top: 10px;">Страницы</div> | |||
noresultsheader= | |||
}} | }} | ||
}} | </ul> | ||
<!-- Подключаем JS --> | |||
<script> | |||
document.addEventListener("DOMContentLoaded", function() { | |||
var sectionHeader = document.getElementById("section-header"); | |||
var sectionList = document.getElementById("sections-list"); | |||
// Проверяем, есть ли элементы <li> внутри <ul> | |||
if (sectionList && sectionList.children.length === 0) { | |||
sectionHeader.style.display = "none"; | |||
} | |||
}); | |||
</script> |