0

I'm trying to create a simple CMS to ingest contents and publish files. I'm using Drupal 8 with Feeds module to read xml files from a directory and it works fine.

I can't figure it out how I can take the information saved in my custom content and publish them to a file in another directory. Anyone can help?

Thx Luca

Luca
  • 15
  • 3
  • Hard to understand what you are wanting to do. – 2pha Jan 20 '20 at 22:54
  • I'm using Drupal 8 with Feeds module. I created a custom type, say Article with two fields Title and Text. I created a Feed to read xml files from a directory to create new Article contents. I'm wondering if it is possible to create another feed to take the list of articles and write it to a file in a directory. I hope this clarifies what I'm trying to do. – Luca Jan 21 '20 at 14:27
  • The feed module does not write files afaik. So you want a "file" that lists the articles? What type of "file"? Can you not just use the views module to generate an xml that lists articles? – 2pha Jan 21 '20 at 23:38

1 Answers1

0

Could you create a view to render the desired output for the content you're after and then use the Views data export module to export that view into a file?

I note the following:

This module also exposes a drush command that can execute the view and save its results to a file.

drush views-data-export [view-name] [display-id] [output-file]

If you can do it with Drush you can do it with PHP.

So potentially you could write hooks to manage the export of files based on the activity of the feed. E.g. The hook_ENTITY_TYPE_insert would allow you to perform logic when a node of a particular content type is created.

dabonde
  • 359
  • 1
  • 11