Änderungen von Dokument Unterseiten-Kacheln (Makro)
Zuletzt geändert von Christian Holzner am 2026/11/09 11:09
Von Version 2.1
bearbeitet von Christian Holzner
am 2026/08/19 15:48
am 2026/08/19 15:48
Änderungskommentar:
Wiki-Makro childtiles (Unterseiten-Kacheln) anlegen/aktualisieren
Auf Version 5.1
bearbeitet von Christian Holzner
am 2026/10/27 19:08
am 2026/10/27 19:08
Änderungskommentar:
Wiki-Makro childtiles (Unterseiten-Kacheln) anlegen/aktualisieren
Zusammenfassung
-
Objekte (1 geändert, 0 hinzugefügt, 0 gelöscht)
Details
- XWiki.WikiMacroClass[0]
-
- Makro-Code
-
... ... @@ -56,15 +56,25 @@ 56 56 #set($_url = $_childPage.getURL()) 57 57 #set($_img = "") 58 58 ## 59 - ## Suche nach Bildern in Attachments 59 + ## Kachelbild: zuerst explizites Piktogramm.* (wie im linken Menue, 60 + ## Panels.SectionNav), sonst Fallback auf das erste Bild-Attachment. 60 60 #set($_atts = $_childPage.getAttachmentList()) 61 61 #foreach($_attachment in $_atts) 62 62 #set($_fileName = $_attachment.getFilename().toLowerCase()) 63 - #if($_fileName.endsWith('.jpg') || $_fileName.endsWith('.jpeg') || $_fileName.endsWith('.png') || $_fileName.endsWith('.gif') || $_fileName. contains('icon') || $_fileName.contains('thumbnail'))64 + #if($_fileName.startsWith('piktogramm.') && ($_fileName.endsWith('.jpg') || $_fileName.endsWith('.jpeg') || $_fileName.endsWith('.png') || $_fileName.endsWith('.gif') || $_fileName.endsWith('.svg') || $_fileName.endsWith('.webp'))) 64 64 #set($_img = $_childPage.getAttachmentURL($_attachment.getFilename())) 65 65 #break 66 66 #end 67 67 #end 69 + #if($_img == "") 70 + #foreach($_attachment in $_atts) 71 + #set($_fileName = $_attachment.getFilename().toLowerCase()) 72 + #if($_fileName.endsWith('.jpg') || $_fileName.endsWith('.jpeg') || $_fileName.endsWith('.png') || $_fileName.endsWith('.gif') || $_fileName.contains('icon') || $_fileName.contains('thumbnail')) 73 + #set($_img = $_childPage.getAttachmentURL($_attachment.getFilename())) 74 + #break 75 + #end 76 + #end 77 + #end 68 68 ## 69 69 ## Hole Unterseiten-Anzahl 70 70 #set($_subPages = $_childPage.getChildren()) ... ... @@ -87,8 +87,8 @@ 87 87 #end 88 88 ## 89 89 #set($_card = $_card + '</div>') 90 - #set($_card = $_card + '<div style="flex: 0 0 auto; height: 52px; padding: 8px 10px; display: flex; align-items: center; justify-content: center;">')91 - #set($_card = $_card + '<h4 style="font-size: 11px; font-weight: 600; color: #003b65; margin: 0; line-height: 1.25; text-align: center; text-transform: uppercase; font-family: Ubuntu, sans-serif; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;">' + $escapetool.xml($_title) + '</h4>')100 + #set($_card = $_card + '<div style="flex: 0 0 auto; height: 52px; padding: 5px 10px; display: flex; align-items: center; justify-content: center;">') 101 + #set($_card = $_card + '<h4 style="font-size: 11px; font-weight: 600; color: #003b65; margin: 0; line-height: 1.25; text-align: center; text-transform: uppercase; font-family: Ubuntu, sans-serif; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;">' + $escapetool.xml($_title) + '</h4>') 92 92 #set($_card = $_card + '</div></a>') 93 93 ## 94 94 #set($_output = $_output + $_card)


