It would be great if Feeds module → support could be added.
In my case, when I use Feeds to import nodes from CSV files, I'd like to be able to selectively disable Simple XML Sitemap for some of the nodes.
A Feeds target needs to be added in /src/Feeds/Target/SimpleSitemap.php. I'm not familiar with Simple XML Sitemap's internal logic, so I don't know what code needs to be added, but here's the basic idea:
<?php
namespace Drupal\simple_sitemap\Feeds\Target;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\feeds\FeedInterface;
use Drupal\feeds\Plugin\Type\Target\FieldTargetBase;
/**
* Provides a generic field target.
*
* @FeedsTarget(
* id = "simple_sitemap",
* field_types = {
* "metatag"
* }
* )
*/
class SimpleSitemap extends FieldTargetBase {
/**
* {@inheritdoc}
*/
protected static function prepareTarget(FieldDefinitionInterface $field_definition) {
return $definition;
}
/**
* {@inheritdoc}
*/
public function setTarget(FeedInterface $feed, EntityInterface $entity, $field_name, array $values) {
if ($values = $this->prepareValues($values)) {
}
}
}
None. Feeds handles the UI based on the target.
None.
None.
Postponed
4.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.