Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joernroeder/silverstripe-external-assets
allows you to access your assets and other static files such as css and js via different (sub)-domains
https://github.com/joernroeder/silverstripe-external-assets
Last synced: about 4 hours ago
JSON representation
allows you to access your assets and other static files such as css and js via different (sub)-domains
- Host: GitHub
- URL: https://github.com/joernroeder/silverstripe-external-assets
- Owner: joernroeder
- Created: 2013-05-09T14:50:32.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-05-11T17:15:45.000Z (over 11 years ago)
- Last Synced: 2023-03-23T10:40:26.787Z (over 1 year ago)
- Language: PHP
- Size: 133 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Silverstripe External Assets
Allows you to access static files as ~~well as javascript and CSS~~ from external (sub)-domains.
## How-To
1. Use `ExternalImage` instead of `Image` in your DataObjects and Relations.
2. Set up your external domain in your hosting setup and point to the assets folder or silverstripes root directory.
2. Set up your `config.yml` with the following options:
### config.yml
- __domain_name__: The domain over which the files should be available.
- __external_name__: The subdomain under which the files are accessible.
The final URL is assembled with the SilverStripe domain.
- __external_points_to_assets__: Indicates if the domain points to the assets folder, and it can be removed from the URL.### Assets via sub-domain
With the following Configuration your assets will be loaded from a sub-domain: `protocol://static.yourdomain.com/imageName.jpg`
```
---
Name: SubdomainAssets
---
ExternalAssetsConfig:
external_name: 'static'
external_points_to_assets: true
```### Assets via external domain
To load the assets from a different domain, the following configuration can be used and the file will be accessible at the following URL: `protocol://bar.foo.domain/assets/imageName.jpg`
```
---
Name: ExternalAssets
---
ExternalAssetsConfig:
domain_name: 'bar.foo.domain'
external_points_to_assets: false
```## Todo
- add support for regular files
- add support for javascript and css files## Have fun!