boboldehampsink / import

DEPRECATED - Import plugin for Craft CMS
MIT License
177 stars 28 forks source link

Asset searching, include subfolders #102

Open davist11 opened 8 years ago

davist11 commented 8 years ago

It would be awesome if it would include subfolders when searching for an asset.

davist11 commented 8 years ago

I did this in a hacky way and added

foreach ($folderIds as $folderId) {
    $folder = craft()->assets->getFolderById($folderId);
    $subFolders = $folder->children;

    foreach ($subFolders as $subFolder) {
        $folderIds[] = $subFolder->id;
    }
}

To the case ImportModel::FieldTypeAssets: in ImportService.php. Probably a much better way to do this since it only searches immediate children subfolders, but it's at least enough for me now.

boboldehampsink commented 8 years ago

Will look into this.

futurefabric commented 8 years ago

+1 from me for this feature, would be incredibly useful.

klepl commented 7 years ago

Same here.