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 ...
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 ...
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 ...
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 ...
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 ...
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.
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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(){
...
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 ...
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 ...
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 ...
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:
...
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 $...
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 $...
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, $...
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 ...
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 ...
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, ...
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) {
...
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 ...
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:
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 ...
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 ...
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/...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
feeds × 8827 × 279
importing-exporting × 169
views × 118
8 × 66
nodes × 61
entities × 60
commerce × 51
taxonomy-terms × 37
6 × 33
media × 23
cron × 22
migrations × 21
theming × 20
files × 19
rules × 19
datetime × 14
users × 13
database × 10
i18n-l10n × 9
9 × 9
location × 9
ubercart × 8
social-network × 8
blocks × 7