-<!-- @file Documentation for the @BootstrapSetting annotated discovery plugin. -->
+<!-- @file Documentation for the @BootstrapSetting annotated plugin. -->
<!-- @defgroup -->
<!-- @ingroup -->
# @BootstrapSetting
Replace all of the following instances of `THEMENAME` with the actual machine
name of your sub-theme.
-Create a file at `./THEMENAME/src/Plugin/Setting/THEMENAME/Accessibility/SkipLink.php`
+Create a file at
+`./THEMENAME/src/Plugin/Setting/THEMENAME/Accessibility/SkipLink.php`
with the following contents:
```php
<?php
namespace Drupal\THEMENAME\Plugin\Setting\THEMENAME\Accessibility;
-use Drupal\bootstrap\Annotation\BootstrapSetting;
use Drupal\bootstrap\Plugin\Setting\SettingBase;
-use Drupal\Core\Annotation\Translation;
/**
* The "THEMENAME_skip_link_id" theme setting.
* title = @Translation("Anchor ID for the ""skip link"""),
* defaultValue = "main-content",
* description = @Translation("Specify the HTML ID of the element that the accessible-but-hidden ""skip link"" should link to. (<a href="":link"" target=""_blank"">Read more about skip links</a>.)",
- arguments = { ":link" = "http://drupal.org/node/467976" }),
+ * arguments = { ":link" = "https://www.drupal.org/node/467976" }),
* groups = {
* "THEMENAME" = "THEMETITLE",
* "accessibility" = @Translation("Accessibility"),
* )
*/
class SkipLink extends SettingBase {}
+?>
```
Helpfully Bootstrap adds a global `theme` variable added to every template
following contents:
```twig
-<a href="#{{ theme.settings.THEMENAME_skip_link_id }}" class="visually-hidden focusable skip-link">
+<a href="#{{ theme.settings.THEMENAME_skip_link_id }}"
+ class="visually-hidden focusable skip-link">
{{ 'Skip to main content'|t }}
</a>
```
click the `Clear all caches` button. Or if you prefer, run `drush cr` from the
command line.
-VoilĂ ! After this, you should have a fully functional `@BootstrapSetting` plugin!
+VoilĂ ! After this, you should have a fully functional `@BootstrapSetting`
+plugin!
## Public Methods {#methods}