`
haohappy2
  • 浏览: 325840 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

An Introduction to the Drupal Features Module

 
阅读更多

When you create a feature like a photo gallery, slideshow, blog or forum for Drupal, it involves installation of quite a few individual modules. In addition, each module often requires a lot of configuration.

Wouldn't it be nice if you could just create a feature just once and reuse it time and again, no matter how many modules and much configuration it needs?

That's the goal of the Features Module for Drupal. Create something once. Re-use it easily on as many sites as you wish.

Create a feature before you start

Before you can experience the power of this module, you need to actually create a feature. A feature might be a photo gallery, slideshow, calendar or something even more complex.

In this tutorial, we're going to use a sliding testimonial feature. Here's a tutorial showing how we created it:Using the Views Slideshow Module in Drupal 7. If you want to follow this Features tutorial exactly, please go through the steps of the Views Slideshow tutorial first.

tutuploadsmedia_1335312014931.png

To minimize the confusion while you're learning, we also suggest you have a clean Drupal site to install your new feature on. It will be less complicated when you go to check your work.

Step 1. Download and Install the Features Module

Step 2. Create the Feature

Go to Structure > Features and click Create feature.

These are the settings you'll need to enter:

  1. Name: make sure this is a unique name and not used by anything else. Do not use a term like blog or audio that might be used by a native module or one you might install.
  2. Description: Describe the package.
  3. Package: Create a group name for your feature.
  4. Version: This will actually become a module you can install, so be sure to include the actual Drupal Version here.
tutuploadsmedia_1335306874265.png

Step 3. Edit Components: Content type

  • Scroll down to Edit components.
  • Choose Content types: node.
tutuploadsmedia_1335306937502.png
  • You will see the display of the content types you have defined.
  • Choose Testimonial (or whichever one you want to build the feature for.)
tutuploadsmedia_1335307052135.png
  • Most of what needs to be included in the feature is shown as auto-detected on the right side of the screen after you choose the content type.
tutuploadsmedia_1335307097341.png

Step 4. Edit Components: Views

  • Choose Views from Edit components dropdown.
  • Choose the Testimonial Slider view.
tutuploadsmedia_1335308249840.png

Step 5. Edit Components: Add the Image Style

  • Repeat the process we used above to add Image styles: image and the testimonial_thumbnail to your feature.
  • There may be much more that needs to be added depending on the complexity of your feature. Discovering what is essential is a lot easier with the fewer components you have on the site and the simpler the feature. That's why we suggest starting with a clean install and a new and simple feature until you get experience.
tutuploadsmedia_1335309209109.png

Step 6. Download the feature you just created

  • Scroll to the bottom and click Download Feature.
  • Download the file and save it to a directory on your computer.
  • On your other site, go to Modules > Add New > Browse and upload the file you just downloaded. It will install just like any other module.
tutuploadsmedia_1335309416806.png

Step 7. Enable the feature on the new site

  • Go to Modules after you install the feature and you will see the new feature installed. Notice that on this fresh install, I am missing a couple of required dependencies, Features and Strongarm. This won't work until all the requirements are installed. I'll install those now.
tutuploadsmedia_1335309811551.png

 

Step 8. Start using the new feature

  • The new feature is represented by a new content type that was automatically added.
  • All the settings and views that I created when I created the original testimonial slider are also included. I could also have included the permission settings or any other settings for components that were available in the "Edit Components" field.
  • Essentially I have "rubber stamped" the Testimonial slider and can now install it on any site like any other module. You can do this with any feature you create.
tutuploadsmedia_1335310694935.png
 
分享到:
评论

相关推荐

    Drupal 8 Module Development 2nd Edition

    In his spare time, he runs webomelette, a Drupal website where he writes technical articles, tips, and techniques related to Drupal development. Table of Contents Developing for Drupal 8 Creating ...

    Learning Drupal 6 Module Development

    This book will give you a clear, concise and, of course, practical guidance to take you from the basics of creating your first module to developing the skills to make you a Drupal developer to be ...

    drupal 7 module development

    Drupal 7 模块开发是 Drupal 内容管理系统(CMS)中的一个重要环节,它允许开发者扩展 Drupal 的功能,以满足特定网站或应用的需求。Drupal 7 是 Drupal 的一个主要版本,发布于2011年,它引入了大量改进和新特性,...

    Drupal 7 Module Development

    电子书 Drupal 7 Module Development

    Drupal.8.Development.Beginners.Guide.2nd.Edition.epub

    Introduction to the Field Types API and Developing the Custom Field Module Chapter 5. Theming in Drupal 8 Chapter 6. Enhancing the Content Author's User Experience Chapter 7. Adding Media to Our Site...

    Drupal.8.for.Absolute.Beginners.1430264667

    This book teaches you the basics of HTML, CSS, JavaScript, and PHP in relation to Drupal, so that you can begin to use this popular CMS with all of its features. You will first learn how to set up ...

    Drupal 8 Explained: Your Step-by-Step Guide to Drupal 8

    Drupal 8 Explained is for people who want a fun and clear introduction to Drupal and requires absolutely no experience with Drupal, content management, site construction, programming, scripting, or ...

    Learning Drupal 6 Module Development may 2008

    《Learning Drupal 6 Module Development may 2008》是一本专为 Drupal 6 开发者量身定制的指南,旨在帮助读者深入了解 Drupal 模块开发的各个环节。这本书的出版时间为2008年,那时 Drupal 6 是该开源CMS(内容管理...

    drupal 在线客服 module

    "drupal 在线客服 module" 是 Drupal 生态系统中的一个重要组件,它为网站提供了集成在线客服功能的能力。这个模块使得访客可以方便地与客服代表进行实时交流,通常包括像 QQ 和旺旺这样的即时通讯工具。 QQ 和旺旺...

    Drupal7ModuleDevelopment.pdf 英文原版

    Drupal 7 Module Development

    drupal module five star

    drupal module five stardrupal module five stardrupal module five stardrupal module five stardrupal module five star

    the definitive guide to drupal 7

    #### 标题:The Definitive Guide to Drupal 7 **标题概述:** 本标题明确指出这是一份关于 Drupal 7 的全面指南,意味着书中将涵盖 Drupal 7 的所有核心概念、功能及实践技巧。 #### 描述:《The Definitive ...

    Drupal 6 Themes: Create new themes for your Drupal 6 site with clean layout and powerful CSS styling

    Drupal 6 Themes is an ideal introduction to theming with Drupal 6. If you want to create a striking new look for your Drupal 6 website, this book is for you. This book is a revised, updated and ...

    Drupal模块开发指南【完整版】Drupal 7 Module 开发指南

    Drupal模块开发是构建在Drupal内容管理系统之上的定制化解决方案。通过模块开发,开发者可以向Drupal添加新功能、改进现有功能,以及集成第三方服务。Drupal模块化的设计让网站的扩展和定制变得非常灵活和强大。 ##...

    The.Definitive.Guide.to.Drupal.7

    #### 描述:本书为《The Definitive Guide to Drupal 7》(第一版),作者为 Benjamin Melançon,是一本详细介绍 Drupal 7 的专业书籍。 #### 知识点详解: ##### 一、Drupal 7 入门篇 1. **搭建 Drupal 7 网站 ...

    drupal 6.12

    the mod_rewrite module and the ability to use local .htaccess files. For Clean URLs support on IIS, see "Using Clean URLs with IIS" (http://drupal.org/node/3854) in the Drupal handbook. - Various ...

Global site tag (gtag.js) - Google Analytics