Hi EE enthousiasts,
I need some advise on the following matter. I’m working on a gallery website with a lot of art by lots of artists. Visitors can find info about the artist, their work, and in may have the possibility to reserve a certain piece of art which they want to buy or rent.
The data is already available as xml. I have 3 xml files:
artists.xml artrwork.xml reservations.xml
I’ve found a very easy way to import those databases into EE through the DataGrab module. That works just perfectly. However, I can’t figure out a fast, easy solution to connect artists from artists.xml to specific artwork in artwork.xml
I thought about EE relationships or playa, but for as far I know, relationships have to be set manually. Since there are many artist and many different artworks this would take a long time to accomplish. Next to that, the XML-files will be updated daily.
I feel the solution lies into the unique number every artist has. This number can be found into all the XML-files.
Example Nodes in artist.xml
<row>
<artistNumber>15006</artistNumber>
<artistName>004</artistName>
etc. etc.
</row>Example Nodes in artwork.xml
<row>
<artistNumber>15006</artistNumber>
<artWork>lovelyArt001</artWork>
</row>
<row>
<artistNumber>15006</artistNumber>
<artWork> lovelyArt002</artWork>
</row>
<row>
<artistNumber>15008</artistNumber>
<artWork> otherLovelyArtFromOtherArtist001</artWork>
</row>
etc. etc.How can I connect a specific artist to another without doing this manually? I hope you understand my problem (not native English speaker) if there are any questions, feel free to ask them.
I hope anyone can help me out!
Thanks, Jef
[Mod Edit: Moved to the Development & Programming forum]
Let me try to put this more into EE language:
I have 2 channels: 1) Artists 2) Artworks
Both channels have one custom field containing a unique artist number. How can I automatically connect a particular ‘artist entry’ to the corresponding ‘artwork entry’?
Since there are a lot of artists, and artwork - changing daily - it would be too much work to do this manually. I thought about relationships (Playa plug-in) - but for as far I know, you have to set the relations manually in EE.
Any idea’s?
Thanks, Jef
Hi Jef,
There is no native way to set up relationships automatically like this. Since both sets of data (channels/XML) have the artist ID it might be possible to create a module or accessory that you could run after the import and set up the relationships in the exp_relationships DB table. Shall I move this thread to the Development & Programming forum so that you can get some community input into how this might be done?
Cheers
Greg
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.