site: visitors see the design alone, not XWiki's chrome
Captain Bob, 2026-11-07: "Menu bar". For guests only, the .com pages and the .org landing page hide XWiki's top bar, breadcrumb, title block, page menu, panels, footer and tour, and the design runs the full width (a velocity check on $isGuest; the stylesheet in a literal block). Logged in, the wiki is all there. Checked on a phone and a desktop: the chrome is hidden on Main, Inquiries and TryIt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GE3SDvQn5EoxdGufk84zz2
This commit is contained in:
@@ -39,3 +39,26 @@ def lock(html, root_marker):
|
||||
html = html.replace(root_marker, root_marker.replace("<div ", '<div class="%s" ' % ROOT_CLASS, 1), 1)
|
||||
html = re.sub(r'style="([^"]*)"', _lock_style, html)
|
||||
return STYLE + "\n" + html
|
||||
|
||||
|
||||
# For visitors (guests) only, the page is the design alone: XWiki's own chrome -- the top bar with
|
||||
# Register and Log-in, the breadcrumb, the title and "Last modified", the page menu, the side panels,
|
||||
# the footer and the welcome tour -- is hidden, and the design runs the full width. Logged in, the
|
||||
# wiki is all there, to edit with. (Captain Bob, 2026-11-07: "Menu bar".)
|
||||
GUEST_CHROME = """{{velocity}}
|
||||
#if ($isGuest)
|
||||
#[[{{html clean="false"}}<style>
|
||||
#menuview, #hierarchy_breadcrumb, .document-header, #xdocFooter, #footerglobal, #leftPanels, #rightPanels,
|
||||
#leftPanelsToggle, #rightPanelsToggle, .tour, .tour-backdrop, #bootstrap_tour_restart, .xtour-restart,
|
||||
#xwikimaincontainerinner > a.btn { display: none !important; }
|
||||
html, body, #xwikimaincontainer, #xwikimaincontainerinner, #contentcontainer, #contentcolumn, .main,
|
||||
#mainContentArea, #xwikicontent, #mainContentArea .row { background-color: #0A1222 !important; }
|
||||
#contentcontainer, #contentcolumn, .main, #mainContentArea, #xwikicontent, #mainContentArea .row {
|
||||
width: 100% !important; max-width: none !important; margin: 0 !important; padding: 0 !important; border: 0 !important; float: none !important; }
|
||||
#xwikicontent > .ssos { border: 0 !important; }
|
||||
#xwikimaincontainer { padding: 0 !important; }
|
||||
.main hr:not(.ssos hr), #xwikicontent > :not(.ssos) { display: none !important; }
|
||||
</style>{{/html}}]]#
|
||||
#end
|
||||
{{/velocity}}
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user