Drupal 7 modulo. info File description

Source: Internet
Author: User

Label:

Drupal uses the. info file to save topic (theme) and module (modules) basic data (metadata).

Coding: We recommend using UTF-8. This is a no BOM (Byte Order Mark).

Here is an example of a. Info

Name = really Neat Widgetdescription = provides a really Neat widget for your site ' s sidebar.core = 7.xpackage = Viewsdepe Ndencies[] = viewsdependencies[] = panelsfiles[] = Tests/example.testconfigure = Admin/config/content/example

The attributes he contains are:

    • name must be
    • Description recommended
    • Core must be
    • StyleSheets
    • Scripts
    • Files
    • Dependencies
    • Package
    • Php
    • Version is not encouraging .
    • Configure
    • Required
    • Hidden
    • Project is not encouraging. Used only for encapsulation
    • The project status URL is used only for custom modules that are not submitted to drupal.org.

Explain:

Name (required)

This will show the name of the module, written as readable. Don't write really_neat_widget here.

Name = really Neat Widget

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvc3rldmvuahpoyw5n/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast ">

Description (Recommended)

It is best to write a simple description of the module using a single line. up to 255 characters .

Description = Provides a really neat widget for your site ' s sidebar.

The description can contain links, which makes it very convenient for users to link to the specified page. Learn about the information and use of many other modules.

Description = Domain Manager by <a href= "http://petermoulding.com" >peter moulding. Com</a>.

Core (required)

The Drupal version number that your template applies to. Let's say Drupal 7 writes 7.x.

Note The version number cannot specify a child version number. Write 7.12 wrong

Core = 7.x

stylesheets (optional)

Let's say you need a CSS file for every page. Drupal 7 agrees to join you here.

Format can refer to the topic (theme) in the. Info

stylesheets[all][] = Node.css

Scripts (optional)

Suppose you need to use JavaScript files on every page, you can join here.

scripts[] = Somescript.js

A lot of other information that can be involved in the management of the JavaScript in Drupal 7

Files (optional)

Drupal now supports the dynamic load code register. To support this feature. All modules must pre-read the code files that include the class (classes) and interface (interface) declarations in the. info file.

files[] = Tests/example.test
when a module is activated (enabled). Drupal will scan the file declared in all files again, indexing all the classes (classes) and interfaces (interface) that can be found.

When the class is first visited, it will be loaded by PHP on its own initiative.


Dependencies (optional)

Additional module support required to execute the module

Dependencies[] = viewdependencies[] = Panels

Note: Although only the module View and Panels are used here, they will use the module chaos Tools, so they will increase their own initiative.

If you want to specify a module that requires a version number, you can use the following expression method

Dependencies[] = modulename (Major.minor)

Major is the major version of the digital expression. Minor can be either a number or a letter representation of the minor version: X can be used to denote no matter what the minor version. The following example

Dependencies[] = Exampleapi (1.x) test_dependencies[] = AutoLoad (>7.x-1.5)

In the example above, the module installs the example API board 1, regardless of the minor version of the module (e.g. 1.0, 1.1, 1.2-BETA4 etc).

The dependencies[] property in the. info file also agrees to select the specified version number

  • = or = = Equals (selectable: default is equal sign)
  • > Greater than
  • < less than
  • >= big equals
  • <= small equals
  • ! = does not equal

Version greater than 1.0

Dependencies[] = Exampleapi (>1.0)

Version requires 7.x compatibility and is greater than 1.5

Dependencies[] = Exampleapi (>7.x-1.5)

also supports multiple version number dependencies, separated by commas

Dependencies[] = Exampleapi (>1.0, <=3.2,!=3.0)

You can also use the system as the module name. To specify the minimum Drupal core version number.

This module is performed at least at Drupal 7.53.

Dependencies[] = System (>=7.53)

Package (optional)

Categorize the modules for easy searching. If you do not write, you will be in Others. Note that uppercase and lowercase are sensitive here. Views and views are two categories.

Punctuation should not be used here.

Package = views


PHP (optional)

Specifies that the template performs the lowest PHP version number

php = 5.3

For example, this means that the module cannot perform the version number that was in 5.3. If you don't write, just use the same version number as Drupal.

Some features of PHP are sometimes used with the new version number. This is where the module needs to be updated with a version number that is newer than the core requirement.

Version (not encouraged)

Assuming that the modules are advertised to drupal.org, they will give you a version string. Let's say you're just writing your own, you can write the version you want, or you don't write.

Since I wrote it myself, I didn't give it to the version, so it was empty.

Configure (optional)

Displays the path to the module configuration page.

When the module is activated. The "Configuration (Configurre)" and "Permissions (Permission)" links are displayed. This link is attached to the Overview (overview) page of the module configuration

Configure = Admin/config/content/example

Point confirgure, you will jump to Admin/config/content/example, configure the module.

Required (optional)

Assuming that the module is absolutely necessary and cannot be closed, write:

Required = TRUE
These modules are actively activated (enabled) at Drupal installation time. This is typically used with Drupal's core modules (e.g. node, user, etc.)

Hidden (optional)

Set if the module or theme is not visible

Hidden = TRUE

Generally this is used in test modules

Project (not encouraged, used only for encapsulation)

This property cannot be used by the maintenance personnel of the module. When the code uploads drupal.org. They're going to have to allocate strings here on their own initiative.

This setting is primarily to match the upgrade Status module so that you can monitor the version number upgrade to alert the administrator that a new version number is available.

Project status URL (only for custom modules that are not submitted to drupal.org)

Agree that the module maintainer defines a URL that allows the upgrade Status module to check if their module needs to be upgraded. Assuming that the module is not advertised on the drupal.org, the parameter should be defined here. The URL should point to an XML format. This XML should be put in Http://my.domain.com/projects/{project}/{core}, in this example.

Project Status URL = http://my.domain.com/projects

References and changes: https://www.drupal.org/node/542202



Copyright notice: This article blog original articles, blogs, without consent, may not be reproduced.

Drupal 7 modulo. info File description

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

Tags Index: