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

Changing the screenshot image of a theme

This recipe details the steps involved in changing the screenshot image associated with a theme. This image provides the user with a preview of what the site will look like when the theme is enabled. This is normally only required when we are working with a sub-theme or a custom theme.

Getting ready

Once the theme is just about ready to go, visit the front page of the site to take the screenshot. Since we are providing a snapshot of the theme, temporarily swap the name of the site with the name of the theme. It might also be useful to prepare some example content for display on the front page to obtain an accurate representation of the style and layout of our theme.

How to do it...

Adding a screenshot for our theme can be done via the following steps:

  1. On the front page, press ALT + Print Screen to take a screenshot of the active window.

    Note

    Mac users can use Command + Shift + 3 while Linux users should be able to bring up the screenshot utility relevant to their distribution by pressing Print Screen.

  2. Open up a graphics editor and paste the screenshot within.
  3. Make a wide selection of the theme incorporating different elements such as the position of the logo, breadcrumb, fonts, node styles, and so on.
  4. Crop and resize to 150x90 pixels which is the standard size for theme screenshots.
  5. Save the image as a PNG file named screenshot.png.
  6. Finally, copy the file to the theme's folder.

Visiting admin/build/themes (Home | Administer | Site building | Themes) should confirm that screenshot.png is being used to represent our theme.

How it works...

Drupal automatically looks for a file named screenshot.png in the theme's folder and, if found, includes that image as a preview of the theme on the theme management page.

There's more...

Each theme's .info file provides the syntax required to specify many of the theme's configuration settings. This also includes nominating the screenshot file to be used.

Using the .info file

The screenshot image can also be specified in the theme's .info file using the following syntax:

screenshot = mytheme.png

where mytheme.png is the name of the screenshot file.

主站蜘蛛池模板: 凌源市| 东兴市| 苏尼特左旗| 定襄县| 岑巩县| 铅山县| 佛教| 东方市| 郑州市| 抚顺县| 萨嘎县| 惠安县| 景宁| 治县。| 芮城县| 开封县| 海晏县| 孝义市| 同心县| 太仓市| 县级市| 安图县| 武夷山市| 门头沟区| 合肥市| 金湖县| 浦城县| 青阳县| 咸宁市| 武宁县| 青州市| 抚州市| 黄骅市| 儋州市| 栾川县| 通城县| 灵宝市| 临邑县| 莱阳市| 荆州市| 龙岩市|