# @BootstrapPrerender - [Create a plugin](#create) - [Rebuild the cache](#rebuild) --- ## Create a plugin {#create} We'll use `Link` implemented by this base theme as an example of how to add custom classes and an icon to make the link look like a Bootstrap button. This example will only work if the link is passed some sort of `#context` when the render array is built, like the following: ```php 'link', '#title' => t('Download'), '#url' => Url::fromUserInput('/download', [ 'query' => ['item' => '1234'], ]), '#context' => [ 'downloadButton' => TRUE, ], ]; ?> ``` Replace all following instances of `THEMENAME` with the actual machine name of your sub-theme. Create a file at `./themes/THEMENAME/src/Plugin/Prerender/Link.php` with the following contents: ```php getContext('downloadButton')) { $element->addClass(['btn', 'btn-primary', 'btn-lg'])->setIcon(Bootstrap::glyphicon('download-alt')); } // You don't always have to call the parent method when sub-classing, but // it is generally recommended that you do (otherwise the icon that was // just added wouldn't work). parent::preRenderElement($element); } } ?> ``` ## Rebuild the cache {#rebuild} Once you have saved, you must rebuild your cache for this new plugin to be discovered. This must happen anytime you make a change to the actual file name or the information inside the `@BootstrapPrerender` annotation. To rebuild your cache, navigate to `admin/config/development/performance` and 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 `@BootstrapPrerender` plugin!