Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

javascripts/css links no longar valid in SilverStripe 4.1 #175

Open
Martimiz opened this issue Apr 10, 2018 · 3 comments
Open

javascripts/css links no longar valid in SilverStripe 4.1 #175

Martimiz opened this issue Apr 10, 2018 · 3 comments

Comments

@Martimiz
Copy link

Martimiz commented Apr 10, 2018

SilverStripe 4.1 seems to want javascript/css to live in resources/betterbuttons (fysically public/resources/betterbuttons), unless the path is set from the site root,

so this seems to fix that:
_config.php
use \SilverStripe\Control\Director;
define('BETTER_BUTTONS_DIR', Director::baseURL() . basename(dirname(FILE)));

[EDIT] Sorry: This doesn't fix anything: it strips 'resources' from the url, but that will still generate a 404 (.htacces redirecting everything) :(

Martine

@Martimiz
Copy link
Author

Martimiz commented Apr 10, 2018

For now, in my dev setup, I did a quick and dirty .htaccess fix like this:

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/betterbuttons/javascript.*
RewriteCond %{REQUEST_URI} !^/betterbuttons/css.*
RewriteCond %{REQUEST_URI} !^/betterbuttons/images.*
RewriteRule ^(.*)$ public/$1

that plus _config.php

use \SilverStripe\Control\Director;
define('BETTER_BUTTONS_DIR', Director::absoluteBaseURL()  . basename(dirname(__FILE__)));

... got it working again, but obviously modules in the root are not the thing anymore? What would be the best course? Besides better buttons finally becoming part of core :)

Martine

@derralf
Copy link

derralf commented Apr 17, 2018

that somehow did't work for me, so i just added a symlink in the /public/ folder:
ln -s ../betterbuttons betterbuttons

@Martimiz
Copy link
Author

Yes, you’re right, I ultimately wound up with css/javascript/images in public too - but your symlink is a far nicer workaround for now 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants