By gp177 on
I suspect I'm missing something very simple...
I'd like to automate the creation of a block when a site is created (via our custom profile) or when the theme is enabled. It would be simple to just run a couple SQL inserts but I'd prefer to do it the right way (if there is a better way).
Comments
hook_block or views import
To me , the best way for a developer is to use hook_block on a profile module(if you're creating one, the module can only consist on hook_block)
There is another way: create a view with a block display and export the view. Then your profile needs to enable views module and import the view.
I don't know anyway (at least not a proper one) to create a block from the theme.(not for D6 at least)
cheers,
Thanks for the info francort.
Thanks for the info francort. That gives me a couple things to look into.
I'm thinking I might give up and use SQL. I looked at the code for block_add_block_form_submit in the D6 API and I'm pretty confident I could just recreate the SQL that gets generated there without much issue.
I noticed in the D7 API that it looks like there are better ways to do this.