Hot answers tagged

13 votes

Programmatically import a feed

Your code seems to be OK. I use some similar code in one of my projects (this a csv importer, similar concept): function custom_function($importer_id, $csvfile_path) { // Load the Feeds Source ...
user avatar
  • 2,115
10 votes
Accepted

Feeds - Background process vs Batch API

I've been digging through this code, and Feeds does not use Background Process. It uses Job Scheduler From FeedsSource.inc: /** * Background job helper. Starts a background job using Job ...
user avatar
  • 974
10 votes
Accepted

Import CSV to nodes/entities in Drupal 8 including a UI

I do this all the time, making use of migration configuration entities (provided by the migrate_plus module). Define a migration plugin in your migration module's config/install directory, using the ...
user avatar
  • 1,303
9 votes

Feeds: use custom field as unique field for mapping

This tutorial works for me: How to configure unique fields in Drupal feeds importer ? See also the official documentation, which states that you can either use the Field Validation module, or write ...
user avatar
8 votes

Migration from Joomla

I've used Feeds and Menu Export/Import to migrate Joomla sites to Drupal a few times. It's a little tedious but it works. I think the next time I have to migrate Joomla site to Drupal I will use the ...
user avatar
8 votes

How do I hide the link to the RSS feed on the term page?

Under "Structure", "Views", open the "Taxonomy term" view, on the Feed display, under Feed settings set Attach to to none.
user avatar
  • 1,268
7 votes

Disable RSS feed

Drupal 7 For D7 simply use Disable RSS. This module will disable the core RSS feed at http://example.com/rss.xml, and remove any reference to it in the html header. Drupal 8 In D8 the feed ...
user avatar
  • 15.9k
6 votes

Migration from Joomla

You can use Migrate module which provides a flexible framework for migrating content into Drupal. There is one GitHub project available at piyuesh23/joomla_drupal which has already some Drupal ...
user avatar
  • 13.6k
5 votes

How to use feeds with entity reference?

Perhaps the Feeds Tamper: String to ID module might in this situation? A Feeds + Feeds Tamper plugin that resolves strings pulled in from feeds importers and maps them to Drupal entity IDs, so they ...
user avatar
5 votes

How can I parse JSON data from a website and import them as nodes?

I think you have a problem with the "context", and title query. I've tried this configuration and worked for me. The context is the first query and in this case just selects all the nodes, the second ...
user avatar
  • 519
5 votes
Accepted

Feeds importer incremental URL parameter

You want to take a look at the Web Scraper Example. https://www.drupal.org/project/example_web_scraper In Feeds Importer you want to look into the Robots spider setup, which will follow links and ...
user avatar
4 votes

How to export feed agregator list and setting as feature?

I have achieved this using aggregator_save_feed() function in hook_install() or hook_update_N() of my custom module. It's not a feature but there is not much difference. Example: /** * Implements ...
user avatar
  • 7,185
4 votes

How to add multiple terms to a taxonomy via feeds and tamper

Feed Tamper gives you a feature to import multivalued field data using any separator like comma(,) using implode plug-in If you have csv file like below You need add implode plugin for that field in ...
user avatar
  • 3,372
4 votes

How can I parse JSON data from a website and import them as nodes?

Why not just do it custom? Here is an example to get you started. Set your cron on the server to run every hour. This requires entity api /** implements hook_cron **/ function poloniex_cron(){ ...
user avatar
  • 1,361
4 votes
Accepted

Why won't this update in hook_update_n() run in batches correctly?

Why are you expecting it to work as a batch, it's doing exactly what you're asking it to do and processing all the importers in the foreach loop! foreach ($importers as $importer) It's not magic, it ...
user avatar
  • 420
4 votes

Automatically import data from Google spreadsheet using feeds module

Sorry, bit late to the party. How I solved this was: Publish the file to the web using the option in Google Sheets' file menu. This gets you a special link to an always up-to-date version with the ...
user avatar
4 votes

Remove import instance from list using Migrate Tools module

So you want to get rid of the migrations so that they don't appear in the drush ms output? Do this: Removing imported content Upon reading your question the second time, I thought you might even be ...
user avatar
  • 2,895
4 votes
Accepted

How to programmatically alter feed item values before saving

Thanks to No Sssweat, I managed to use an EventSubscriber using afterParse event to do this job. File 1: mycustommodule/mycustommodule.services.yml services: mycustommodule.feeds_subscriber: ...
user avatar
3 votes

how to set the author of the feed item to the author of the feed source in feed importer?

Here is the up to date code. Put this code into a custom module to achieve the desired result: <?php /** * Implement hook_feeds_preserve */ function MODULE_NAME_feeds_presave(FeedsSource $...
user avatar
  • 718
3 votes

Approach to removing extra space at beginning of RSS file?

Someone left a space at the beginning of a module. [space]<?php You can either try to find that bit of code with some tool or command OR put this in includes/bootstrap.inc at line 1112: echo $...
user avatar
3 votes
Accepted

Special non-utf-8 characters appearing in feed imported from a windows based system?

You can use the Feeds Tamper module to do this with a custom plugin. In your module: /** * Implements hook_ctools_plugin_directory(). */ function MYMODULE_ctools_plugin_directory($owner, $...
user avatar
  • 37.7k
3 votes

Feed Import Products ( Commerce ) and Products Category ( Node Page )

The following CSV template and Feed Import settings will import 1 Product Node with multiple Product Entities being referenced. Step 1 - Creating The CSV The following example provides the title and ...
user avatar
3 votes
Accepted

How does Feeds decide if it is going to create a new (or update an existing) entity?

The Feeds module uses the FeedsProcessor object to define what it calls mapping targets for an entity to determine what fields are unique and what can be optionally be set unique in the feeds importer ...
user avatar
  • 1,487
3 votes
Accepted

External RSS Feed in View

The simplest method is to use the Aggregator module included in core. Enable the 'aggregator' module in core Add your RSS feed in Configuration > Web services > Feed aggregator On the same page, ...
user avatar
  • 363
3 votes

How to skip (don't update) some fields from existing node during import if this field already has a value?

Had the same problem. I finally used hook_feeds_presave(), and unset the field I wanted to skip. Here's the code: function mymodule_feeds_presave (FeedsSource $source, $entity, $item, $entity_id) { ...
user avatar
3 votes

Importing Published status from xml using Xpath parser

I suggest installing feeds tamper (https://www.drupal.org/project/feeds_tamper) with this module you can easily convert the yes to a 1 and no to a 0 before saving to the database. This should solve ...
user avatar
3 votes
Accepted

Importing Published status from xml using Xpath parser

Alright, After some search online, I was able to use the innate Xpath functions, so it works with the following expressions:
user avatar
3 votes
Accepted

HTML in square brackets -> output as normal HTML

That's BBCode. One option would be to simply install the BBCode module, which contains a BBCode filter. You can then apply that filter to the text format you're using for the body field, and it'll be ...
user avatar
  • 163k
3 votes
Accepted

Views: Link Title using Text URL field (GUID)

Assuming that you know the link and can construct it from the GUID field (either by some/text/[guid_field_machine_name]/maybe/more/text or just [guid_field_machine_name] or what have you): Using the ...
user avatar
3 votes

How to display an image in a Views RSS feed

First add the Media RSS namespace to your views-view-rss.tpl.php <rss version="2.0" xml:base="<?php print $link; ?>"<?php print $namespaces; ?> xmlns:media="http://search.yahoo.com/...
user avatar

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