Closed (fixed)
Project:
Domain
Version:
6.x-2.4
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
9 May 2010 at 22:34 UTC
Updated:
2 Aug 2010 at 20:59 UTC
Jump to comment: Most recent file
I need to create a lot of domains, close to the number of cities on craiglist.com.
Is there a good way of doing this already? If not, do I need to write code for this?
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | domain_bulk.zip | 2.17 KB | fizk |
Comments
Comment #1
agentrickardThe changes committed here: #761556: Tiny edits to domain_form/domain_form_submit for re-usability will make that easier. But you still need to queue up an array of domains and pass them to
domain_save(). So yes, this needs to be written.Comment #2
fizk commentedThanks, I ended up create a module that uses drupal_execute().
For anyone that needs this functionality, I've attached the module.
To create a domain, go to /admin/build/domain/bulk and input your subdomains using the format site name:subdomain
For example, if the root domain is "example.com", then inputting
sweet candy 1:candy1
sweet candy 2:candy2
will create two active and open domains, sweet candy 1 (http://candy1.example.com), and sweet candy 2 (http://candy2.example.com).
If anyone wants to improve the code, I'd suggest making the module add a textbox to the bottom of /admin/build/domain/create, and use most of the settings on the page as the values for creating the domain.
The module will make use of domain_relationships if it's installed.
Comment #3
fizk commentedComment #4
michelleThanks for this. I need to add about 750 domains and I was getting bored doing it one at a time. I need to do a few other things to the domains but this will make a good base to start from rather than trying to do direct imports into the tables like I was going to try and do.
Michelle
Comment #5
michelleJust gave this a try and it works well. This is useful and shouldn't just be buried in a zip in the issue queue. Any chance of it becoming a sub module, separate project, or even a handbook page?
Michelle
Comment #6
fizk commentedMichelle,
I can create new project for it if you promise to be it's biggest fan :)
Comment #7
fizk commentedHere it is: domain bulk import/export
Comment #8
michelleLOL! Well, it's making my life easier importing 734 domains. :) I'm still doing a bit of clean up before doing it on the live site but it worked great on the dev site with my small test.
Michelle