FR: Use folder name as unique identifier when importing assets #905
Replies: 3 comments 2 replies
-
Further to this: Assets can import into specific sub-folders of a volume as specified an Asset feed. However, when referencing the previously uploaded asset within an asset field for a feed importing into an Entry channel, Craft appears to find the previously uploaded asset in the sub-folder but it gets moved to the root / base dir of the volume, out of the sub-folder where it previously was. Perhaps I am missing something, but in the case where an existing asset is referenced in an asset field on an Entry, it should be possible to define the sub-folder within the volume in the feed options (last screen: field mapping) in which to look for the pre-existing asset. |
Beta Was this translation helpful? Give feedback.
-
I have also been looking at the Craft CMS based event: EVENT_SET_FILENAME in relation to this. https://docs.craftcms.com/v3/extend/updating-plugins.html#modifyassetfilename It's looking like I cannot prefix a folder path to the filename at this stage, maybe another new event would be required. Something like EVENT_SET_FILE_PATH ? |
Beta Was this translation helpful? Give feedback.
-
Is there a solution to this? I have the same issue or problem. Need to import tons of data where some files do have the same name but in different folders...how can i import and select the correct asset? Asset Field of the entry needs to be one file not multiple. How its at the moment: Setting "Keep both"
Setting "Replace existing"
|
Beta Was this translation helpful? Give feedback.
-
Description
If there is a file with the same name in several different folders within an asset volume, it would make sense to be able to select the folder as a unique field to consider when deciding to update or create new.
Additional info
Beta Was this translation helpful? Give feedback.
All reactions