Questions tagged [.info]

Use it for questions about the file containing information about modules and themes.

Filter by
Sorted by
Tagged with
10 votes
5 answers
10k views

How does Drupal handle autoloading of classes?

How does Drupal handle autoloading of classes through modules? For instance, if I have an Events module, and I declare a class called Event, and then in the .info file I include the class file, how is ...
rybosome's user avatar
  • 941
9 votes
2 answers
2k views

How to make a theme depend on a module?

My theme requires multiple modules to be install before it is fully functional. How can one set module dependency in a theme, so that when a user enables the theme, it will also enable the required ...
latvian's user avatar
  • 807
9 votes
1 answer
2k views

Adding a dependencies in theme info file

Can I use dependencies[] = module name in the theme.info file? I want to create a drupal theme where I using some dependencies module, if I able to mention the dependencies in theme info it will easy ...
Aryashree Pritikrishna's user avatar
8 votes
2 answers
3k views

How to solve "This version is not compatible with Drupal 7.x and should be replaced" error?

I keep getting, "This version is not compatible with Drupal 7.x and should be replaced." error. Could you please look at the content of my .info file and tell me what is wrong with it: name = jeanb ...
Davit Magaldadze's user avatar
8 votes
2 answers
1k views

Weighting Javascript in .info files

Drupal 7 adds a new 'weight' option to drupal_add_js so that you can control the order in which Javascript files are added to the page. Is there any way to do this when adding Javascript in .info ...
cam8001's user avatar
  • 1,074
6 votes
1 answer
2k views

Is it possible to use libraries-extend from a module (instead of theme)?

Problem/Motivation I'm interested in altering/overriding the little bit of HTML markup that's output by core, in my case Drupal.theme.mediaEmbedEditButton (from core/modules/media/js/...
Max Starkenburg's user avatar
5 votes
4 answers
6k views

How can you force a stylesheet reload in Drupal7?

This is about that old trick of tacking a fake query argument onto the URL of a stylesheet (e.g., <link rel="stylesheet" type="text/css" href="http://www.example.com/site.css?v=123">) so that, ...
Jim Miller's user avatar
  • 1,948
5 votes
2 answers
374 views

How to restrict a module to a specific core version?

Drupal 8.3 introduced some changes, which broke a custom module; fixing the changes causes the module to break in previous Drupal versions. One way to handle this would be to require Drupal core to ...
amit's user avatar
  • 444
4 votes
2 answers
161 views

Can I add a "OR" on a dependecy?

I'm working a on a project that needs to have one of their submodules enable but not both. I was wondering if I can have an or statement in the .info so the user would not enable both submodules. ...
itsdarrylnorris's user avatar
4 votes
3 answers
4k views

How can I disable CSS styles from a core module using libraries-override?

I'm trying to disable the CSS styles from the layout discovery module in my theme.info.yml file. I've tried several options, but I can't seem to get it to work. This is what I have now. libraries-...
Nate Dillon's user avatar
4 votes
1 answer
120 views

When should the dependency from a core module be explicit?

The Standard profile declares the Node module as one of the modules it requires, and so does the Minimal profile. That is not true for the History module, which is required from the former but not the ...
apaderno's user avatar
  • 97k
4 votes
3 answers
11k views

Is there any way to force https:// to be used for assets and still be able to define a theme CSS files in its .info file?

I have a theme which defines its CSS files in its .info file, for example with a line like the following. stylesheets[all][] = css/style.min.css The site is accessed using https://, but for some ...
John's user avatar
  • 105
3 votes
1 answer
170 views

Can I define the minimum php version for my module in my .info.yml file?

I need to define the minimum PHP version in my module.info.yml file but I don't know if this is posible using: php: 5.6 If you search about this in the drupal.org documentation you will only see the ...
Adrian Cid Almaguer's user avatar
3 votes
1 answer
61 views

Custom module name conflicts with unsupported contrib module -- how to avoid "This project is no longer supported" warning?

This Drupal 9 site runs a fork of the search_file_attachments module, modified for custom purposes, and for Drupal 9 compatibility. For some time now, the Available updates report has shown, for this ...
TwoMice's user avatar
  • 131
3 votes
1 answer
275 views

How to get update to check Feature Server

I have a custom module hosted on a feature server. When I update Drupal how can I get it to check the Feature Server to see if there is an update there? In the back of my head I thought it was ...
user13134's user avatar
  • 558
2 votes
2 answers
1k views

Splitting up the .module file

I wrote my first module which happens to be in Drupal 7. The module uses hook_menu to correlate URLs with three custom-coded, page call backs. These callback functions that construct the custom html ...
user1706487's user avatar
2 votes
1 answer
215 views

Version numbers of dependencies in testing

If I'm submitting a test to the qa.drupal.org testbot, and my module requires a dev version of another module in order to function properly, is it adequate to declare the version in my module's .info ...
beth's user avatar
  • 9,087
2 votes
3 answers
195 views

Which modules should be listed as dependency of my module?

If my module calls a function of another module, that other module should be listed as a dependency of my module. Now my module only provides some field handlers for the Views module. On the one hand,...
Oswald's user avatar
  • 4,916
2 votes
1 answer
116 views

Why am I urged to include my source files via files[] instead of using include_once?

What is the reason of using the .info file to declare the files used from the module, instead of including them at runtime?
Hamster's user avatar
  • 137
2 votes
1 answer
251 views

How to add conflicts in D8 info.yml?

I want to know how to add conflicts in D8 info.yml. I tried like this in D8 .info.yml: name: Example type: module description: some example. core: 8.x package: Other dependencies: - menu_ui ...
Ajay Reddy's user avatar
  • 3,829
2 votes
1 answer
102 views

How to define the right dependencies in .info, so drush can understand it?

Currently in my booking_timeslots.info I've the following dependencies: dependencies[] = date dependencies[] = date_views dependencies[] = hierarchical_select dependencies[] = hs_taxonomy ...
kenorb's user avatar
  • 14.1k
2 votes
2 answers
192 views

Why are the CSS files in my .info not applied (scripts work fine)?

I have a list of CSS files from a premade theme called artifical reason they are listed in my .info file as such stylesheets[all][] = assets/css/style.css stylesheets[all][] = assets/css/preload.css ...
Matt Beal's user avatar
2 votes
1 answer
2k views

Separate classes in include file not loading?

I have a peculiar problem... I'm trying to simplify my module by breaking up a ton of code into classes, and I have all of the classes in a separate include file that I'm registering in my .info file ...
Lester Peabody's user avatar
2 votes
2 answers
4k views

Why isn't my Sub Theme's CSS file showing up?

I created a sub theme which is intended to just have a few color changes and background image changes. The Base theme is called limon. The sub theme is limon_orange. In the sub theme, i have a ...
Ben's user avatar
  • 615
2 votes
0 answers
302 views

How to use a module-relative path to translations in .info.yml

I'm new to using Drupal and am building a custom module to learn how it all works. I'm building my module in modules/custom/my_module. I have a Dutch locale file in modules/custom/my_module/...
rickdenhaan's user avatar
2 votes
0 answers
2k views

Error: The website encountered an unexpected error. Please try again later [closed]

After I put a new custom theme I did in my theme folder, when I go to my website to install and apply the theme, the site just keeps returning this error: "The website encountered an unexpected ...
racemi's user avatar
  • 79
1 vote
1 answer
37 views

Is the tags section valid in the info.yml file?

I see in the devel.info.yml file a section named tags tags: - developer But I can't find it on the documentation page. Is the tags section valid in the info.yml file or is it just an error?
Adrian Cid Almaguer's user avatar
1 vote
1 answer
57 views

What is the Drupal API for reading Drupal configuration files (.info .make etc.)?

Drupal configurations such as .info, .make appear to follow common structure. There must be Drupal API for reading these configurations from code. How does one load and read these configurations in ...
latvian's user avatar
  • 807
1 vote
2 answers
1k views

Module version format

I would like to know what is the correct version format for custom modules in Drupal 7. I see some contributed modules come with 7.x-1.2-rc1. I don't know what is rc1. When I name my custom module ...
Sithu's user avatar
  • 4,953
1 vote
3 answers
126 views

Autoload files by patterns instead of listing each file

Drupal's "autoloading" requires one to include the files in files[] declarations in the .info file. When there are a lot of files, this becomes: A large, huge, list. Hard to maintain. Is there a ...
berkes's user avatar
  • 3,100
1 vote
2 answers
165 views

Can region be defined outside of the theme's .info file?

Basically I'm trying to reverse-engineer a theme that was developed by another guy. The problem is that I'm not yet quite firm on Drupal ground. So I'm looking onto a management page for blocks and ...
jayarjo's user avatar
  • 1,542
1 vote
2 answers
158 views

Are absolute paths allowed in info files?

I'm writing a .info file for a module, and I want to include a script which has been installed in /sites/all/libraries: So I have included the line below in my .info file: scripts[] = /sites/all/...
Monkeybrain's user avatar
1 vote
1 answer
562 views

How do I enable a custom JS file in my Drupal site? [duplicate]

In my Drupal themes' folder I've created a file named "custom-js.js". I created this file to use 2 jQuery manipulations on a small text block that appears in all pages of the site. My question is, ...
user avatar
1 vote
3 answers
303 views

Overriding css file in theme.info not working as expected

I am trying to remove nice menus css, as per the notes in my Zen theme .info file. I have added the below to the info file, and I haven't provided replacements in my theme so they should be removed. ...
davewilly's user avatar
  • 309
1 vote
1 answer
77 views

Is it a good idea to load the css files from page.tpl file instead of .info file

I am just curious, because i am trying to get my site working for both IE and chrome, and I want it to load only a specific css file. Conditional stylesheets arent working for me, as I cannot see the ...
user1675999's user avatar
1 vote
4 answers
3k views

How to include CSS for a custom admin theme?

I want to include my custom style.css in admin pages in Custom Admin theme I have been create. I am including CSS in .info file as follows name = Example Module description = Custom Example Module ...
Ajay Reddy's user avatar
  • 3,829
1 vote
1 answer
208 views

Using an include file from a different module

I've got a module that I've created just for the sole purpose of sharing .inc files between multiple modules. The modules .module file is empty, as it doesn't do anything. But in the modules .info ...
Arak Tai'Roth's user avatar
1 vote
1 answer
254 views

Problem with Jquery in Durpal 7 [closed]

I am using Drupal 7 and bootstrap theme, I also have installed jquery update module, Now I have created a js (jquery) file and saved it under js folder in bootstrap theme, I tried to call my js file ...
the_summer_bee's user avatar
1 vote
3 answers
1k views

Can't add assets to my Bootstrap sub-theme

I'm currently struggling to include *.css and *.js files to my Bootstrap sub-theme. I use Drupal 8 and the Bootstrap 3 base theme. I followed the instructions of the official documentation and went ...
Zephyr's user avatar
  • 161
1 vote
1 answer
58 views

How to exclude recursive module dependencies?

Is there a way to exclude dependencies of dependencies? For example: my_module.info contains dependencies[] = views dependencies[] = ctools my_sub_module.info contains dependencies[] = my_module ...
John R's user avatar
  • 256
1 vote
0 answers
26 views

File paths aren't pulling in images or stylesheets

I'm sure I'm not the first person to run into this but I can't find another post about it. I'm pretty new to drupal and I'm taking a swing at theming. I'm running into problems right out of the gate....
Jonathan's user avatar
1 vote
1 answer
337 views

Remove js file by template or add condition in info file

I work on drupal 7, I added all js by info file, work well in whole site. But we want to remove or not load of a specific js in a specific content type page. I try by template.php of following code ...
Rituraj Kumar's user avatar
0 votes
2 answers
3k views

Can I add external js and css via module info files?

I have read that I can add js and css file via .info files. Can I add external css and js files there as well? Eg http://somewhere.com/in_a_galaxy
giorgio79's user avatar
  • 4,597
0 votes
1 answer
1k views

How to solve “This version is not compatible with Drupal 7.x and should be replaced” error?

Similar to but the solution doesn't work: How to solve "This version is not compatible with Drupal 7.x and should be replaced" error? I've followed everything I can find but a basic custom ...
o_O's user avatar
  • 362
0 votes
1 answer
54 views

My custom module shows up on the modules list but I cannot enable it, why?

I've written a custom module (custom_data_import) with a .info.yml file and .module files, but the module only shows up in my list of modules and I cannot enable it. Moreover, the .module file seems ...
acey's user avatar
  • 19
0 votes
1 answer
498 views

My Custom drupal 8 module does not shown in modules list

I'm developing my first drupal 8 module, a custom migration module, the info.yml file is written as follow : name : Drupal Center Custom Migrate description : This module provides custom migration ...
Alireza Tabatabaeian's user avatar
0 votes
1 answer
2k views

CSS and JS are not showing

I just started using Drupal 8 and i am already experiencing problems. In my info.yml file I've added library/ies and in my libraries.yml are those files included. And when I clear cache in Admin, the ...
ZeroByte's user avatar
  • 183
0 votes
2 answers
80 views

Book: Drupal 7 Module Development (directions caused weirdness)

I'm reading a book, Drupal 7 Module Development, and I'm hitting some very weird outputs. I created a folder: mysite/sites/default/module/first Inside this folder I created two files. first.info ;...
randomblink's user avatar
0 votes
3 answers
2k views

Getting .info file not found in my custom module, even though it does contain an .info file

I am trying to install my custom module, but the error I get is: modulename.tar.gz does not contain any .info files. My module tar.gz file does indeed contain a .info file. I have installed other ...
vintorg's user avatar
  • 1,993
0 votes
2 answers
32 views

Deleting feature[]=logo from .info file, enlarged the whole website font-size?

During the theme learning I deleted the feature[]=logo line from .info file to check its effect at UI. As expected it got deleted from the toggle list at appearance->theme->toggle option. But ...
CodeNext's user avatar
  • 3,723