Hot answers tagged

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 ...
  • 23.8k
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 ...
  • 6,318
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, ...
  • 3,507
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.
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. ...
  • 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.
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 ...
  • 6,562
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 ...
  • 23.8k
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 ...
  • 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 ...
  • 3,986
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 ...
  • 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,...
  • 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:/...
  • 2,966
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 ...
  • 730
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 ...
  • 3,507
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....
  • 23.8k
3 votes
Accepted

Is it possible to use Update Asset Indexes on a target subfolder or subfolders?

There is no good solution in Craft 2.x, but you probably can put together a plugin or a console app that does what you want it to do. Here's all the background info you, hopefully, need. The whole ...
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; $...
  • 1,369
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 ...
  • 13.3k
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 ...
  • 11.3k
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 ...
  • 6,318
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 ...
  • 23.8k
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 ...
  • 3,400
3 votes
Accepted

Multilinugual Import

We recently built our first multi lingual site on craft and used FeedMe to import our entries. What we did was to set up fields such as enDesc, deDesc, svDesc. Then when we imported our entries into ...
3 votes
Accepted

How would you import content with embedded images, ideally using FeedMe?

There's nothing through Feed Me that handles this elegantly at the moment, and you'd need to either parse your html data before or after the import. We've done this a few times on an import, where we'...
  • 3,507
3 votes

Going from a static site generator (Jekyll or Hugo) to Craft CMS; Export/migrations options?

There is a good plugin called FeedMe that can help with imports. We used it migrating a pretty large EE site without issue. If you can spit out a XML, RSS, ATOM or JSON feed, it should be able to ...
  • 1,527
3 votes

How can I import users from WordPress to Craft CMS?

I don't know how to export users from WordPress, but importing them in Craft can be done with a plugin like Feed Me. There are other plugins out there too depending on the export file you can get out ...
  • 1,456
3 votes

Saving to table field via plugin

The answer on the previous question is a little bit off - you do not want to use json_encode to save the field. Just use the actual array: $tableValue = [ [ "col1": "Product #1", "col2": "5"...
  • 306
3 votes

Preserve formatting when exporting from Wordpress

Just needed to save each entry and formatting corrects itself.
  • 884
3 votes
Accepted

Best practice for multi site development, staging, etc. [Special snowflake details inside]

If I'm understanding correctly, there are two methods I'd suggest; Instead of reconciling the data from Site A, I would first setup Site A with Site B + C and add any new fields/sections you will ...
  • 2,492

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