Reputation: 11
Below is the code of my module's .info file. I created the module for 6.x and 7.x. If core = 7.x the module was working in Drupal7 not D6. In the same way if core = 7.x the module was working in Drupal6 and not D7. I want to create a module to work in both D6 and D7. What can I do? Please help..
name = Synchronize Articles
description = Synchronize Articles.
core = 7.x
; NEW LINE
configure = admin/config/content/synchronize_articles
Above is the code of my module's .info file.
Upvotes: 1
Views: 557
Reputation: 7315
It is true that some hooks operate the same way across different Drupal versions, and if you're providing API functions they will probably stay the same. So it is sometimes possible to write a module that works in either core version, although it won't be most of the time. However you can't use the same .info file for both.
If your module is hosted on Drupal.org, you may be in luck. The packaging system will add the "core=x" line to your .info file automatically. All you have to do is get the packaging system to use the same code branch for both 6.x and 7.x releases.
Upvotes: 0
Reputation: 522
Since you are not able to access the module from the same place for 6.x & 7.x, its just take few lines to make it compatible it with both versions -- Change the lines as per core version requirements!
Upvotes: 0
Reputation: 1004
You can't create a module that works in both, in the sense that you can't say core = 7.x and core = 6.x. There are too many differences between Drupal 6 and 7 for that to be practical. Unfortunately this means that you'll need to maintain two separate codebases for your Drupal Module. Good luck!
Upvotes: 4