I'm working on a theme tailored to iPhone viewing using the jQTouch library. This theme would be a base theme for sub-theme development.
Ideally, including the jQTouch library would be handled via the Libraries API module (D6). The jQTouch library requires a higher version of jQuery than is shipped with D6 (1.3.2) and so the jQuery Update module is required as well.
There is at present no way for a theme to declare modules (or libraries for that matter) as dependencies. I suspect this will become more common in the future as theme developers will come to rely on specific JS libraries/jQuery extensions for UI functionality in their themes.
Tim Knittel
Comments
Comment #1
bertboerland CreditAttribution: bertboerland commentedsorry for noise: subscribing
Comment #2
ohnobinki CreditAttribution: ohnobinki commented+
Comment #3
jefkin CreditAttribution: jefkin commentedI subscribe to the K.I.S.S. principal, so I suggest just telling your users right away.
While by no means a perfect solution, my suggestion here is for anyone who found this entry due to searching for 'theme module dependency' (or the like).
Drupal 8 may incorporate a fancy mechanism for this, Drupal 7 and 6 do not, but in D6 and D7 you can do this, in your template.php in your mytheme_preprocess_page() function add the following:
Yes, this is a bit kludgy, because it just prints out the error. But if your theme might be broken anyway, best to get the message out. And, if your user installed the theme without the module, they'll know instantly what's wrong. If something breaks, like your user uninstalls the dependency, they'll know right away.
So, you've got all you need to solve it right there. You could get more elaborate, perhaps making your warning include where to download the missing module, but meh.
Comment #4
rickvug CreditAttribution: rickvug commentedMarking this issue a duplicate of #474684: Allow themes to declare dependencies on modules, which has more traction. Completely agree.