官术网_书友最值得收藏!

Adding a slogan to the theme

This recipe details the steps involved in adding a slogan to the theme. Site slogans are a common feature on most sites and are typically witty or involve clever wordplay. They are synonymous with catchphrases, tag-lines, mottoes, and so on.

Drupal offers a global setting to store the site slogan which is customarily displayed by themes near the site logo or site name, and is also regularly added to news feeds and site e-mails as part of the site's identity.

Getting ready

Think up a good slogan! This is the biggest stumbling block to getting this recipe right.

How to do it...

Adding a slogan to a theme involves the following steps:

  1. Navigate to admin/settings/site-information (Home | Administer | Site configuration | Site information).
  2. Locate the Slogan textfield and add the slogan here as shown in the following screenshot:
    How to do it...
  3. Click on the Save configuration button at the bottom of the page to save our changes.
  4. Now, navigate to admin/build/themes (Home | Administer | Site building | Themes).
  5. Click on the Configure tab at the top of the page.

    The resulting page should have multiple tabs: one titled Global settings which affects all themes and others representing each enabled theme. Configuration options under the Global settings tab serve as the site's default settings for all themes while equivalent settings within each theme's tab work as overrides for the global settings.

  6. On the Global settings page, look for the Site slogan setting in the Toggle display section and ensure that it is checked.
    How to do it...
  7. Click on the Save configuration button to save our changes.

Tip

If any of the themes have overridden the global settings, then the Site slogan checkbox will also need to be checked in its respective theme tab.

How it works...

Drupal saves the provided slogan as a configuration setting in the database. The theme system makes this setting available as a variable to the theme which outputs it accordingly when the page is being rendered.

In the following screenshot, we can see that the slogan is enabled and is displayed below the logo and name of the site.

How it works...

There's more...

Besides the site slogan, other site variables are also available on the theme configuration pages.

Similar settings

The Drupal Site information page seen in this recipe also contains fields for other settings such as the site name, mission, and footer which are also similarly exposed by themes.

主站蜘蛛池模板: 翼城县| 杨浦区| 犍为县| 班玛县| 北川| 深水埗区| 彰武县| 太仆寺旗| 商都县| 咸阳市| 灵山县| 南陵县| 南和县| 万山特区| 灵宝市| 南昌市| 延吉市| 衡东县| 辉县市| 克山县| 纳雍县| 长岭县| 太康县| 若尔盖县| 宜昌市| 中江县| 洱源县| 宾川县| 灵寿县| 襄汾县| 满城县| 綦江县| 正定县| 进贤县| 凌海市| 上饶县| 会同县| 忻城县| 泸水县| 沅陵县| 济阳县|