9

I am trying to set up my first web site using Drupal 8 an Bootstrap. Unfortunately I wasn't able to show the site's slogan in Bootstrap theme. The slogan is set in /admin/config/system/site-information but is not shown. So I thought by my self, it may not be printed in page.html.twig and tried to include it there. It's preamble says:

 * Available variables:
 * Site identity:
 * - front_page: The URL of the front page. Use this instead of base_path when
 *   linking to the front page. This includes the language domain or prefix.
 * - logo: The url of the logo image, as defined in theme settings.
 * - site_name: The name of the site. This is empty when displaying the site
 *   name has been disabled in the theme settings.
 * - site_slogan: The slogan of the site. This is empty when displaying the site
 *   slogan has been disabled in theme settings.

So I tried to print the slogan by including

{{ site_slogan }}

But this does not have any effect at all.

Can somebody please tell me, how to print the site slogan in Bootstrap?

[The lack of documentation and stable modules and themes should have been considered a release blocker for Drupal 8, but this is only my opinion and off topic here!]

1
  • 1
    I guess you were looking at the documentation in bootstrap's page template? I guess that's out date, when in doubt, check the documentation in the original template in the module (system in this case), that's up to date.
    – Berdir
    Jan 20, 2016 at 7:29

2 Answers 2

16

After some desperate digging I found the solution (come on Drupal guys, don't be shy, give us some documentation!): Go to /admin/structure/block and click the 'configure' button of the block named 'Site branding'. There you can choose which parts of site branding are shown.

9

This is how to get the site slogan to pring in your theme page template without using the branding block (bootstrap or not):

function THEME_preprocess_page(&$vars) {

    $site_config = \Drupal::config('system.site');

    $vars['site_name'] = $site_config->get('name');
    $vars['site_slogan'] = $site_config->get('slogan');

}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.