doublesecretagency / craft-adwizard

Ad Wizard plugin for Craft CMS
Other
7 stars 8 forks source link

Ability to restrict uploads to a specific source #4

Open lindseydiloreto opened 5 years ago

lindseydiloreto commented 5 years ago

Right now, Ad Wizard lets you upload images to any volume you want. It would be great if those uploads could be restricted to a specific folder, to prevent client errors.

terryupton commented 4 years ago

Also looking for this feature @lindseydiloreto. Is it is likely to be on the roadmap anytime soon?

lindseydiloreto commented 4 years ago

I wish. I agree that it would be extremely helpful, but unfortunately it is much lower on the priority list than a lot of other things right now.

And honestly, based on the information in this thread, it's hard to know when I'll be able to make this FR a priority. Andris makes it sound like doing the same thing with Redactor would be a monumental effort, and he built the Assets system in the first place. 😬

I'll definitely keep this thread open as long as necessary, but I wouldn't hold my breath for it being anytime soon.

terryupton commented 4 years ago

Thanks @lindseydiloreto - hadn't realised it might be so difficult but reading that thread it's unlikely to be a FR that gets added 😬. Although is that the same approach? Because your advert image field looks more like a traditional asset field in Craft (where you can control the folders etc) not like the redactor field which I appreciate is quite drastically different....but I have no idea what is occurring behind the scenes? Uneducated in plugin development, I just assumed you would hook into or use a 'Craft' asset field type when you create this type of field within your plugin.

The only other approach I could think that would work, is allowing the actual advert image field to be manually added like with the other custom fields, as then this would use the native craft method of choosing the assets folder etc. Then somehow you assign this as the advert field inside adWizard settings so it knows this is the advert image. Again, this is probably not simple and perhaps would change the whole architecture and functionality of the plugin, so again this might not be plausible 🤷🏻‍♂️.

lindseydiloreto commented 4 years ago

Behind the scenes, we're both (Redactor & Ad Wizard) just mimicking the UI of the native Assets field settings, while doing our best to replicate the actual behavior. That particular aspect of asset management isn't as "plug and play" as we'd all prefer.

Your workaround is interesting, but could potentially create more problems than it solves. Let me put a little thought into that suggestion, and see if it somehow fits into the long term plans.

It sounds like a fair amount of changes to field handling will be made in Craft 3.5 and 4.0. Realistically, we'll probably end up waiting to see what kind of changes Craft itself makes before bending Ad Wizard any further to accommodate assets.

Sorry, I know it's not the answer you wanted to hear. Even without the Craft changes, this task was a fairly low priority. So as dumb as it is to say it... maybe circle back on this in a year or so. 🙃

terryupton commented 4 years ago

Thanks Lindsey. No worries at all.