Feature request : importgroups #917
Replies: 5 comments
-
Hi @pieter-janDB, I've been wanting something like this as well, and I'm actually making a little plugin to be able to handle running Feed Me feeds as groups. Actually, just running the feeds is not so complicated, and I more or less have that running, and could provide some sample code for you to run in a custom module. I wanted to take the chance to ask you, though, if there are some other use cases that perhaps could be built into my plugin (unless there are any signals from P&T that this will be added to the core plugin). For instance, are you running the same feed URL or different once? Are any of the feeds in a group dependent on the result of other groups? Or are they all just separate independent feeds that just happens to be run at the same interval? For instance, in my case I run the same feed, but for different purposes, so I've built a simple caching so that I only need to fetch the external feed data once (per unique feed URL in the group). Also, the feeds are using the results of each other, so that the first feeds are creating elements that are added to the entries created by a later feed. I've worked around this by adding empty dummy elements to the feed so that you can map them in the feed settings, and then I populate the feed later by fetching the elements created. All this works through Feed Me's event hooks. If I'm the only one needing something like this, I could leave it in my custom plugin, but if it's a use case also others need, I could also look at building it into the Feed Me group plugin. |
Beta Was this translation helpful? Give feedback.
-
Hi @kristiansp , I have a connection with an google docs excel sheet to import the data within different sheets. So For example I have some sheets with categories that need to get imported before the products sheet get imported. I didn't have time to take a closer look at automating it yet. I also wanted to make a full import button in my own module CP page that first triggers all categories (for all locales I now have a different import) and then the products. (ideally there would indeed be error callbacks in which the full import is stopped if there is a problem within a category sheet.) Feel free to ask for more input, I look forward to see what you are building. |
Beta Was this translation helpful? Give feedback.
-
@pieter-janDB Ah, cool, it sounds like we are on a bit similar tracks (if I get you correctly that you need your Categories created in an earlier feed, to then be used in the product feed). I'll get in touch over the next days, I think I should at least be able to help you along the way. Having error callbacks if a feed fails might need some workaround, as when a feed is run, it is kicked off to the queue, and I don't think Feed Me throws any error events. Theoretically it should be possible to parse the Feed Me log before running the next feed and look for errors before continuing to the next. More later! |
Beta Was this translation helpful? Give feedback.
-
@kristiansp I will need to implement something like this next week.. Have you got any further with this ? Maybe you could share some code so I can build upon it ? |
Beta Was this translation helpful? Give feedback.
-
@pieter-janDB Sorry, I got a bit hold up with other things, so have not had the time to work much more on the plugin or GUI around this. Let me see if I can give you some pointers anyways. I’m on mobile at the moment, but can post some more thorough code examples later. First, two run the feeds in order, especially if you’re using a cronjob, this is already possible with FeedMe:
You could also write a controller action for your plugin that quite simply calls the feeds in order via the normal controllers If you have control over the Google Sheet, the easiest way would be to make sure there’s an identifier that can link a product’s categories to the once in the category sheet, and running them in the right order would basically be enough. You can set up the mapping to map to different fields of the category element. If you can’t, what I do is to hook onto the You want to add it to Then, in the One last note – at this point in FeedMe’s logic, it doesn’t accept array values. So if you want to add multiple items, like categories, you would need to add them on the following form:
(Obviously this is easier done in a loop.) Hope that helps a bit? I’ll make sure to check back, and can provide more pointers and examples if needed, but maybe this already gets you a bit along the way. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I am not sure if this is where I should post my feature request but here I go..
I would like to group different feed me streams into a group so I can run multiple imports in sequence without having to click them one by one.
Maybe even include a function you can start from our own modules like startImportById and startImportGroupById ?
Thanks for your intrest.
Beta Was this translation helpful? Give feedback.
All reactions