Skip to content

Commit

Permalink
Merge pull request nextcloud#33266 from nextcloud/bugfix/noid/skip-co…
Browse files Browse the repository at this point in the history
…ntent-public

Add skip content buttons to the public page layout
  • Loading branch information
PVince81 authored Jul 20, 2022
2 parents f24ce9b + e3dc796 commit de08b53
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions core/templates/layout.public.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
<?php foreach ($_['initialStates'] as $app => $initialState) { ?>
<input type="hidden" id="initial-state-<?php p($app); ?>" value="<?php p(base64_encode($initialState)); ?>">
<?php }?>
<div id="skip-actions">
<?php if ($_['id-app-content'] !== null) { ?><a href="<?php p($_['id-app-content']); ?>" class="button primary skip-navigation skip-content"><?php p($l->t('Skip to main content')); ?></a><?php } ?>
<?php if ($_['id-app-navigation'] !== null) { ?><a href="<?php p($_['id-app-navigation']); ?>" class="button primary skip-navigation"><?php p($l->t('Skip to navigation of app')); ?></a><?php } ?>
</div>

<div id="notification-container">
<div id="notification"></div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions lib/private/TemplateLayout.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,8 @@ public function __construct($renderAs, $appId = '') {

$this->assign('initialStates', $this->initialState->getInitialStates());

$this->assign('id-app-content', '#app-content');
$this->assign('id-app-navigation', '#app-navigation');
$this->assign('id-app-content', $renderAs === TemplateResponse::RENDER_AS_USER ? '#app-content' : '#content');
$this->assign('id-app-navigation', $renderAs === TemplateResponse::RENDER_AS_USER ? '#app-navigation' : null);
}

/**
Expand Down

0 comments on commit de08b53

Please sign in to comment.