Closed (fixed)
Project:
Patterns
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
18 Aug 2009 at 00:18 UTC
Updated:
18 Aug 2009 at 11:37 UTC
It would be really great if modules could exposes patterns that they come with directly, instead of having to be placed in one of the patterns directories.
Is this possible?
Comments
Comment #1
ChrisBryant commentedThis should already be possible by creating a folder called "patterns" inside your module folder and then adding your patterns there. It was added in the last month with the following commit/revision:
http://drupal.org/cvs?commit=242188
http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/patterns/pa...
Please try that and confirm it's working as intended for you.
Cheers!
Comment #2
ChrisBryant commentedI forgot to mention that a module can supply a pattern to be run when that module is installed: From the patterns.module file...
Comment #3
sarvab commentedYou can do this now, but recent changes make it require an extra step then what Chris posted above.
Basically you need to have your module implement hook_patterns_directory() and return the path to a directory that can contain either a /patterns directory, or a /components directory for use with the patterns module. So in you're module if you were to implement that hook and do: return drupal_get_path('module', 'mymodule'); it would look in /path/to/your/module/patterns for available patterns.
Comment #4
jbrown commentedThanks guys!