1

I'm fairly new to Craft so I could be missing out on some basics.

I need to import an events feed (xml) using the FeedMe plugin. The feed has some Link tags. Ex.

<link rel="sales" type="text/html" href="[LINK TO TICKETSHOP]" />
<link rel="image" href="[LINK TO IMAGE]" />

I've got an Asset field but I can't properly set the Feed Element. It only shows "<link/@href>" or "<link/@type>". If I select @href then it goes though all the elements with @href and generates a lot of errors because some aren't assets.

I've tried <link/@rel="image"> in the default value field but then it imports the same value for all the Events. So all the Entries end up with the same image.

Is there a way to manually define the Feed Element?

Edit: Sorry I forgot the format for the code

1

This is actually a bit of an issue with XML-based feeds. To Feed Me, both your node's are link nodes. They have different attributes for sure, but Feed Me doesn't identify nodes by their tag and attributes, so it'll look at all tags called link to get the image.

As you've stated, you'll be getting a bunch of errors due to this. Can you restructure your feed at all? The ideal method would be to rename one to <image> for instance.

Right now, there's no way to manually define field mapping, as its already complicated. You're more than welcome to submit a feature request.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.