0

I'm building a biodiversity database and am looking for the easiest way to display all the information online. I know I can do this without a CMS, but I have too tight a deadline to waste time designing something fancy from scratch (easier to slap a quick theme).

I'm struggling between choosing Wordpress (experience in it) and Drupal (it will definitely work, but much more time-consuming to make it look nice). I'd love to choose Wordpress, but I'm wondering if it can handle the main aspect.

Namely, can I automatically generate pages for every row in my main SQL table? Say I have a table with this structure:

ID | Rank | Parent | Name

This table will have 6000+ rows, and each Name must have its own dynamically-generated page. Populating each page is simple with custom templates which I already have.

My problem is having to manually make 6000+ pages, one for every name, and then making new ones every time a new species is added. Is there some function or plugin that will generate pages dynamically, with the custom template, and even with a nice permalink?

I can do this in Drupal, but don't know how I can do it in Wordpress.

4
  • Will you need to reimport these records into WP periodically, or is it a one-time import? Commented Oct 16, 2015 at 13:53
  • The table will be continuously updated, so I'm hoping to write a php script flexible enough to query the table. Otherwise, no problem manually reimporting.
    – trilobutt
    Commented Oct 16, 2015 at 13:59
  • Your data doesn't really match up with WordPress post data. It isn't clear how things are supposed to work. It is relatively easy to import posts with wp_insert_post() by the way, but as I said, I wouldn't be sure where to put the pieces.
    – s_ha_dum
    Commented Oct 16, 2015 at 14:55
  • I was afraid of that :) I didn't know about wp_insert_post(), thanks for the heads-up. I'm not looking for an elegant back-end for now, so hopefully there's a quick-and-dirty solution I can hack together with it.
    – trilobutt
    Commented Oct 16, 2015 at 19:32

1 Answer 1

1

Use a shell script and WP-CLI in your SSH console. Your shell script has to fetch each element of your table and launch the function of WP-CLI that creates a post in Wordpress. You can even provide a sort of template in the call of the function. WP-CLI is a useful tool, but you can also do it your own way by using Wordpress cli scripts (see documentation).

2
  • This might be a good solution, I'll test it out. Thanks a lot!
    – trilobutt
    Commented Oct 30, 2015 at 15:26
  • It's really a very useful and easy tool to manage wordpress without installing plenty of plugins. I don't earn money to say that :)
    – RMS
    Commented Oct 30, 2015 at 15:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.