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

BootstrapSettings useCDN() does not add CSS CDN #345

Closed
dmbeer opened this issue Mar 21, 2014 · 3 comments
Closed

BootstrapSettings useCDN() does not add CSS CDN #345

dmbeer opened this issue Mar 21, 2014 · 3 comments

Comments

@dmbeer
Copy link
Contributor

dmbeer commented Mar 21, 2014

Hi I am trying to use the CDN option for bootstrap css, when I add the following to my WicketApplication code like the following

final IBootstrapSettings settings =  new BootstrapSettings();
settings.useCdnResources(true);
Bootstrap.install(this, settings);

the CSS reference is not added but the js reference is. I am often left with a incomplet tag in the head section of the HTML page.

See https://github.com/dmbeer/wicket-bootstrap-example for example project.

@dmbeer
Copy link
Contributor Author

dmbeer commented Mar 21, 2014

Hi After some further research and debugging it appears that when you switch to CDN you don't get the CSS added or jquery. As a work around I have added the CSS using the renderHead overide on my base page. This is a temporary fix.

String cdnUrl = String.format(IBootstrapSettings.CSS_CDN_PATTERN, IBootstrapSettings.VERSION);
ResourceReference ref = new UrlResourceReference(Url.parse(cdnUrl));
response.render(CssHeaderItem.forReference(ref));

@martin-g
Copy link
Owner

I cannot reproduce the issue with the quickstart app.
I've commented out the lines that setup SpaceLab theme (https://github.com/dmbeer/wicket-bootstrap-example/blob/master/src/main/java/example/WicketApplication.java#L66-L67) and the generated HTML for bootstrap.min.css is:
<link rel="stylesheet" type="text/css" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" />
And it loads successfully.

SpaceLab theme also loads fine.

Should I do something else to be able to reproduce it ?

@dmbeer
Copy link
Contributor Author

dmbeer commented Apr 18, 2014

@martin-g This seems to work now, I wonder if this was fixed by other changes made to the theme problems. Closing for now as all seems to work.

@dmbeer dmbeer closed this as completed Apr 18, 2014
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