Hot answers tagged

17

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/boboldehampsink/import which can import from CSV sources. Check out http://straightupcraft.com/craft-plugins for a list of current Craft plugins.


15

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


11

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.


9

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 YourVariable { public function renderFormMacro($macro, array $args) { // Get the current template path $originalPath = craft()->path->...


7

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 of arrays: $tableData = array( array( "col1" => "data", "col2" => "data", ) ); // Then simply encode it when you set your field ...


6

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 for the entry's category field (in this example its handle is categoryFieldHandle): $category = new CategoryModel(); $category->groupId = 2; // Or whatever ...


5

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, ATOM or JSON feeds. Feeds can be setup as a task in Craft's Control Panel, or called on-demand for use in your twig templates. A common use-case for this ...


5

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 not reversible, which means that the passwords cannot be recovered. Which, in turn, means that if you import the user information into Craft, the members still ...


5

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


5

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. Import Plugins Import plugins like FeedMe and Import provide you a user interface where you can map fields from your import file to fields in Craft. Assuming you ...


5

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


4

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 craft/templates It works but I'd love a less hacks way to do it, either through a plugin or some built-in means.


4

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 unknown. Adding a custom password column to the database is a bad idea, since Craft user/password management is pretty deeply embedded within the system. Here's ...


4

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 import plugin to bring in the data. The plugin allows you to map the data to the fields in Craft. Craft supports tables natively but you need a way to import ...


4

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 last part: you're the one deciding how things will work, the CMS doesn't come with opinions about how your blog posts will be constructed or organized. You can ...


4

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 fields like Matrix on Variant Layouts is possible. Any required fields you don't include will throw an error and tell you they are needed. An example of the Orders ...


3

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 an eye on the plugin page. Update: FeedMe 2.0 now supports multiple entry types, including Commerce Products: http://sgroup.com.au/plugins/feedme/getting-...


3

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.dateCreated, just as you have done.


3

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 IDs. Then, if it's a new entry, you would do: $myTagIds = array(1,2,3,4); // your tag IDs $entry = new EntryModel(); $entry->setContentFromPost(array( ...


3

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 a native user, it tries authenticating a legacy user using the legacy system's particular hashing method. You could add another driver by copying the existing ...


3

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 into your browser’s JS console on any webpage: var data = [ { title: "Entry Title", body: "Body content" }, { title: "Entry Title 2", body: "More body ...


3

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 herring by pointing to the import itself. In your Twig code: import pulls in a macro (or macros). _self just means "this template file". "mcr_home" is just how ...


3

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 that lets you choose what fields to pull things like the title, description, etc. from which solves this problem. Check out the section of the wiki docs on SEO ...


3

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 needed if you are doing advanced SEO work and need to have the ability to modify your SEO values to be different than other field values that already exist on your ...


3

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; $entry->enabled = true; $entry->getContent()->title = "Here goes my title!"; // new matrix and matrix block $block = array(); $block['new1'] = array( ...


3

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 indexing process is controlled by javascript as well but let's just pretend you've instantiated the AssetIndexTool class and are operating on that via ...


3

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 equivalent before your client added the additional content, you may be able to just migrate over your clients database and replace your own database and get both back ...


3

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 craft mapping all of our multi lingual content to be spread across these fields in a single locale. Once this was done we then ran a script across the database ...


3

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 import it. FeedMe Plugin I am not sure if it is Craft 3 ready yet, though.


3

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 of WordPress. If you don't know how to export users from WordPress, you'd need to ask that on the WordPress SE if that exists :)


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