Can Orchard Theme have dependencies in Theme.txt file?

Topics: Core, Customizing Orchard
May 30, 2013 at 3:53 AM
I know that Module can have dependencies defined in the manifest. But i'm not sure if Theme does the same. Based on my own experiment it seems not quite right. I personally think it would be a reasonable feature to have dependency support added to Theme.
Coordinator
May 30, 2013 at 7:10 AM
Yes, themes can have dependencies, but you should avoid code in themes, as much as possible.
Developer
May 30, 2013 at 12:04 PM
It seems that you're not following the Orchard Hungary blog, shame on you! You'd have the answer one day earlier :-D.
One fully legitimate scenario for having dependencies in themes is for modules containing client-side libraries, like jQuery in the example.
Coordinator
May 31, 2013 at 6:25 AM
How does that scenario require taking a dependency?
Developer
May 31, 2013 at 11:18 AM
And now I learned that jQuery is somehow a core module despite being not in the core, so this doesn't apply to jQuery... But it still applies to other modules containing JS libraries: if your theme Require()s a script from a module you can't guarantee that module being enabled if the theme doesn't take a dependency on it. If there's no dependency then you can disable the module and the theme will break with a YSOD.
Coordinator
May 31, 2013 at 7:47 PM
Ah yes, that's right.
Jul 27, 2014 at 9:35 PM
What is the recommended place to put helper code such as additional extension methods that I may want to use in my views? Thinking of general purpose helpers that could be used in modules or themes. Is this a scenario where a Theme could have a legitimate module dependency, or is there a better place to put such code?
Aug 14, 2014 at 1:00 PM
Developer
Aug 14, 2014 at 1:13 PM
Unfortunately yes, the issue is out of our reach but will be resolved ASAP.
Oct 23, 2014 at 5:19 PM
Since the orchardproject.hu site is still having DNS issues, can you post the answer to bingles' question here? Duplication, yes, but only an ever-so-slight pollution of the internet.

And, since I'm running up against the same question, I'd love to know the answer! :-)
Developer
Oct 24, 2014 at 12:21 PM
We're now just days away from getting the site back online!

What would be the question specifically? The blogpost just demonstrates that you can declare dependencies in Theme.txt the same way as with modules.
Oct 24, 2014 at 6:27 PM
Piedone wrote:
We're now just days away from getting the site back online!
Great news, Zoltán! I know it must have been making you all crazy with it being down.
What would be the question specifically? The blogpost just demonstrates that you can declare dependencies in Theme.txt the same way as with modules.
You just answered the question. Assuming the syntax is the same (and I can check that in the code), I should be good!

Thanks.
Developer
Oct 24, 2014 at 6:32 PM
Yes, it is exactly the same :-). Actually the classes that hold extenion info have everything related both to modules and themes. So even if not everything is useful for both you could even have tags for modules for example :-),