我想根据站点名称将图像放在 diff 文件夹中的 cloudinary 中
在 config/initializers/cloudinary.rb 中:
# override default behaviour by alchemy_cloudinary gem - use folder
# for default site use application name
# for other sites use the site name
module AlchemyCloudinary
class DragonflyDataStore
private
def public_id(uid)
# ret = File.basename(uid, ext(uid, true))
folder = "#{ApplicationController.helpers.cfg.folder_name}#{Alchemy::Site.current.host == '*' ? '' : '-'+Alchemy::Site.current.name.downcase}"
puts "****** ITGLOG folder: #{folder}"
ret = "#{folder}/#{File.basename(uid, ext(uid, true))}"
# ret = "#{Rails.application.class.parent_name}/#{File.basename(uid, ext(uid, true))}"
ret
end
end
end
它工作正常,每个图像都保存在具有站点名称的不同文件夹中。
我在 中的图片库有问题Alchemy CMS admin
,它显示了所有图片,而不仅仅是每个站点特定的图片。
当我尝试在特定站点的特定页面中选择图像时,它shows up all the images
而不是images filtered by the current site
.
我们对于它可以做些什么呢?
先感谢您