silverstripe / silverstripe-s3

Silverstripe module to store assets in S3 rather than on the local filesystem (SS4/SS5 only)
BSD 3-Clause "New" or "Revised" License
20 stars 25 forks source link

TinyMCE Support? #31

Closed wsheldon closed 4 years ago

wsheldon commented 4 years ago

Great extension, thanks! Is there any way to leverage it to store the TinyMCE compressed JS on S3 as well, i.e

public/assets/_tinymce/tinymce-cms-7c6cb07104.js

Or possibly feature request? Many thanks

obj63mc commented 4 years ago

We have that store locally specifically for functionality reasons of the CMS admin. This is set in /_config/tinymce.yml

Basically when this would upload to S3, the CMS couldn't find the file as it would only look on the local filesystem (link based off of the sites base url) when it generates the link to those files.

If you want to store them on S3 anyways, simply overwrite the yml config in your sites app.yml or someplace else and set

LocalGeneratedAssetHandler:
  class:  'SilverStripe\Assets\Flysystem\GeneratedAssets'
      properties:
        Filesystem: '%$League\Flysystem\Filesystem.localpublic'
SilverStripe\Forms\HTMLEditor\TinyMCECombinedGenerator:
  properties:
    AssetHandler: '%$LocalGeneratedAssetHandler'

To use the default S3 public adapter instead.

obj63mc commented 4 years ago

Checkout this as well as other related issues from this closed issue

https://github.com/silverstripe/silverstripe-s3/issues/18