Hot answers tagged

17 votes
Accepted

How do I import data into Craft?

There is craftimport which is an 'unsupported' starting point for importing entries from an XML source. https://github.com/clearbold/craftimport There is also Import: https://github.com/...
user avatar
  • 1,661
15 votes

How do I import data into Craft?

If you’re comfortable with PHP, Craft has some plugin APIs that make creating content relatively painless. For example, EntriesService::saveEntry().
user avatar
11 votes

How do I import data into Craft?

As far as ExpressionEngine goes, it looks like Mark Reeves has cooked up a starter plugin for that purpose. Bob Olde Hampsink made an import plugin as well that works with CSV's.
user avatar
  • 3,921
9 votes

Is it possible to use _includes/forms outside of the Control Panel?

I've been able to render CP templates in the front end using some methods in PathService and TemplatesService, which you could use inside your own Template Variable to render the macros: class ...
user avatar
  • 4,361
7 votes
Accepted

Inserting data into a table fieldtype via plugin?

The thing to keep in mind here is that a table field contains a simple JSON string. So you can (and should) use PHP's native json_encode function to prepare your data... // Your data will be an array ...
user avatar
  • 23.6k
6 votes
Accepted

Best way to programmatically create categories?

To create a category, you'd have to use the craft()->categories->saveCategory() method, and feed it a CategoryModel. Having done that, you can use the ID of your new category to create an array ...
user avatar
  • 6,288
6 votes

Creating entries from JSON feed - plugin?

Check out the FeedMe plugin. It's pretty similar to DataGrab and Importer. From the README: Feed Me Feed Me is a Craft plugin to make it easy to import entries and entry data from XML, RSS, ...
user avatar
  • 3,402
5 votes

How do I import data into Craft?

It's not mentioned above, but in my experience the FeedMe plugin is by far the best way to import content.
user avatar
5 votes

Importing Members from ExpressionEngine

Tricky is a mild way of putting it. EE and Craft both hash (not encrypt) their passwords differently. Hashing differs from encryption in a few ways, but the most important one here is that hashing is ...
user avatar
5 votes

Importing Blog posts from Drupal into Craft

There are several import plugins that can help you import your data from Drupal, but they may require a bit more configuration than the InstaBlog plugin that is designed for a specific use case. ...
user avatar
  • 13.3k
5 votes

How can I import a large number of new entries into Craft 3

One option is to create a Craft 2 site, import the entries there, and then upgrade that site to Craft 3.
user avatar
4 votes
Accepted

Is it possible to use _includes/forms outside of the Control Panel?

We've done this on a few sites and you're right it's extremely helpful. The only way I've found to get it to work is to simply copy the "_includes/forms" folder from craft/app/templates to the sites ...
user avatar
4 votes

Importing tables and Tablepress like plugin functionality

How do you plan to manage it in Craft? If you want each row as a separate entry, create a section to hold the data, setup the fields you want to use to match each column, then use Bob Olde Hampsink's ...
user avatar
  • 6,477
4 votes
Accepted

How can I import existing users with passwords stored in a different format than Craft's hash format?

Short answer, it can't be done. Possibly with some extensive hacking, but I would highly caution against that. Directly importing passwords isn't really possible, since the original passwords are ...
user avatar
  • 23.6k
4 votes

How can I export or move content from one Craft system into another? (with exactly the same configuration)

This can be a challenging situation. Craft content can be highly relational which makes it tricky to just export and re-import. Scenario 1: If your database and your clients database were both ...
user avatar
  • 13.3k
4 votes

Migrating my Blogger site to CraftCMS

I migrated a Blogger site by writing a Craft plugin to parse Blogger's XML and save images, posts, and categories into the Craft setup established with the client. The challenge with Craft is that ...
user avatar
  • 3,921
4 votes
Accepted

Is it possible to import orders into Craft Commerce?

Sprout Import supports importing Craft Commerce Orders on Craft 3. I can't speak to which fields are required off of the top of my head but importing to custom fields, variants, and even custom ...
user avatar
  • 13.3k
4 votes
Accepted

Feed Me Import Categories from CSV

As per the docs...if you add config/feed-me.php to your project containing <?php return [ '*' => [ 'dataDelimiter' => '-|-', ] ]; and format your CSV like id,title,...
user avatar
  • 56
4 votes
Accepted

Feed me plugin, cURL error 60

I would try adding the following to your feed-me.php config file: <?php return [ '*' => [ 'clientOptions' => [ 'verify' => false, ], ], ]; c.f. https:/...
user avatar
4 votes
Accepted

Import large number of entries every day - 1 million

You could write a service method that reads the import file and divides it into chunks, then it could dispatch a queue job for each chunk which does the actual entry creation/update. This way you ...
user avatar
  • 728
3 votes
Accepted

How do I import existing products into Craft Commerce with the FeedMe or Import plugins?

Feed Me only supports Entries at this stage. Its on the short-term roadmap in allow importing into all Elements, including Commerce Products. This cannot be achieved through hooks at the moment. Keep ...
user avatar
  • 3,402
3 votes
Accepted

Updating a Users Join Date?

Yup, that's correct. The craft_elements.dateCreated column is the one that is referenced by the user's Join Date. For the sake of being thorough, I prefer to copy that same value into craft_users....
user avatar
  • 23.6k
3 votes
Accepted

import _self throwing ElementCriteriaModel could not be converted to string

In short, those two have nothing to do with each other. What's more likely is that the error is being triggered by the imported script. It's possible that your stack trace is just giving you a red ...
user avatar
  • 23.6k
3 votes

How can I import existing users with passwords stored in a different format than Craft's hash format?

The Legacy Login plugin handles authentication from legacy systems such as ExpressionEngine and BigCommerce. It works by intercepting the login, and if the given credentials fail to authenticate with ...
user avatar
  • 3,400
3 votes
Accepted

Creating entries from JSON feed - plugin?

The Import plugin by Bob Olde Hampsink can import CSVs. JSON support is on the roadmap, but in the meantime, it’s easy enough to convert JSON to a CSV with a little bit of Javascript. Just paste this ...
user avatar
3 votes
Accepted

Best way to create tags under new EntryModel?

To relate the tags, all you'd have to do is feed the entry's tag field an array containing tag IDs. So, after creating (or finding existing) tags, you should end up with an array with one or more tag ...
user avatar
  • 6,288
3 votes
Accepted

Add entries in bulk

Right now, a plugin is the way to go. There are a couple of Craft importing plugins that might get you where you want to go. Long-term, we've got some plans around importing and exporting data from ...
user avatar
  • 66.5k
3 votes

Import data into Sprout SEO

The problem you're running into is that FeedMe doesn't know how to import into custom element types; I think a special hook would need to be written. If you use my SEOmatic plugin it has a FieldType ...
user avatar
3 votes

Import data into Sprout SEO

In general, I feel the field types in the current version Sprout SEO (2.x) are overused. We're currently working on a big update that should help resolve this but the field types are really only ...
user avatar
  • 13.3k
3 votes

Import body field into a matrix text block

Nevermind. Clearbold's Craft Import plugin has the starting code for it. // new entry $entry = new EntryModel(); $entry->sectionId = 1; $entry->typeId = 12; $entry->authorId = 123; $...
user avatar
  • 1,369

Only top scored, non community-wiki answers of a minimum length are eligible