Изменения документа Поддомены2
<
>
отредактировано Andrey Shilin
на 2025/04/16 12:23
на 2025/04/16 12:23
отредактировано Михаил Бич
на 2025/06/09 18:12
на 2025/06/09 18:12
Изменить комментарий:
Imported from XAR
Комментарий
-
Свойства страницы (2 изменено, 0 добавлено, 0 удалено)
-
Объекты (1 изменено, 0 добавлено, 0 удалено)
Подробности
- Свойства страницы
-
- Автор документа
-
... ... @@ -1,1 +1,1 @@ 1 -xwiki:XWiki.sh ilin1 +xwiki:XWiki.mishael - Содержимое
-
... ... @@ -5,6 +5,8 @@ 5 5 #if ($request.getCookie('subdomain')) 6 6 #set($cookie = $request.getCookie('subdomain')) 7 7 #set ($currentSubDomain = $util.decodeURI($cookie.value)) 8 +#elseif($request.get('subdomain')) 9 + #set ($currentSubDomain = $request.get('subdomain')) 8 8 #end 9 9 #set ($mainDoc = $xwiki.getDocument('Main.WebHome')) 10 10 #set ($subdomains= [] ) ... ... @@ -16,7 +16,9 @@ 16 16 #set ($selfShow = true) 17 17 #end 18 18 #end 19 -#foreach ($child in $mainDoc.getChildrenReferences()) 21 +#set($q = "select doc.fullName from XWikiDocument as doc, BaseObject as obj where doc.fullName = obj.name and obj.className like 'SUZ.Code.SubDomainClass' and doc.space not like '%Sandbox%'") 22 +#set($query = $services.query.hql($q).execute()) 23 +#foreach ($child in $query) 20 20 #set ($childDoc = $xwiki.getDocument($child).getTranslatedDocument()) 21 21 #set ($xobject = $childDoc.getObject('SUZ.Code.SubDomainClass')) 22 22 #if ($xobject) ##Включаем только страницы с SubDomainClass
- XWiki.UIExtensionClass[0]
-
- Executed Content
-
... ... @@ -1,18 +1,21 @@ 1 -{{velocity}} 1 +{{velocity output="false"}} 2 2 ##Показать меню подразжелов только на определенных страницах 3 -###set ($classesForMenu = ['SUZ.Materials.Code.MaterialsSectionClass', 'SUZ.Methodology.Code.MethodologySectionClass', 'SUZ.Indicators.Code.IndicatorsClass']) ##Массив классов, где нужно показывать меню 4 -###set ($selfShow = false) 5 -###set ($objNames = $doc.getxWikiObjects().keySet()) ##Список наименований классов в текущем объекте 6 -###foreach ($obj in $objNames) 7 -## #if ($classesForMenu.contains($obj)) 8 -## #set ($selfShow = true) 9 -## #end 10 -###end 11 -###if ($selfShow) ##Условие показа меню 3 +#set ($classesForMenu = ['SUZ.Materials.Code.MaterialsSectionClass', 'SUZ.Methodology.Code.MethodologySectionClass', 'SUZ.Indicators.Code.IndicatorsClass']) ##Массив классов, где нужно показывать меню 4 +#set($q = "select doc.fullName from XWikiDocument as doc, BaseObject as obj where doc.fullName = obj.name and obj.className like 'SUZ.Code.SubDomainClass' and doc.space not like '%Sandbox%' and doc.fullName not like '%SUZ%'") 5 +#set($query = $services.query.hql($q).execute()) 6 +#set ($selfShow = false) 7 +#set ($objNames = $doc.getxWikiObjects().keySet()) ##Список наименований классов в текущем объекте 8 +#foreach ($obj in $objNames) 9 + #if ($classesForMenu.contains($obj) && $query.size() > 0) 10 + #set ($selfShow = true) 11 + #end 12 +#end 13 +{{/velocity}}{{velocity}} 14 +#if($selfShow) 12 12 #panelheader($services.localization.render('suz.menu.'+'Поддомены')) 13 13 {{menu type="vertical collapsible open" id="subdomains"}} 14 14 {{include reference="$uix.doc.documentReference" /}} 15 15 {{/menu}} 16 16 #panelfooter() 17 -# ##end20 +#end 18 18 {{/velocity}}