External Stylesheet and Bootstrap Usage

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
BPAT
Jr. Propeller Head
Posts: 5
Joined: Thu Apr 21, 2016 7:14 am

External Stylesheet and Bootstrap Usage

Post by BPAT »

Hello, I am trying to use both an external stylesheet and Bootstrap in a project. The stylesheet works fine by putting the following into the Toolbar Custom JavaScript field:
$('<link>')
.appendTo($('head'))
.attr({type : 'text/css', rel : 'stylesheet'})
.attr('href', 'Content/Resources/custom_skin.css');


I thought I would do the same for Bootstrap. I put this in, but nothing appears and I don't get any console errors:
$('<link>')
.appendTo($('head'))
.attr({type : 'text/css', rel : 'stylesheet'})
.attr('href', 'Content/Resources/bootstrap-3.3.6-dist/css/bootstrap.min.css');
$('<script>')
.appendTo($('head'))
.attr('href', 'Content/Resources/bootstrap-3.3.6-dist/js/bootstrap.min.js');

So questions, Is this not a way of using Bootstrap in a project? What would be the right way of going about this?

Thanks for any help anyone can lend.
NorthEast
Master Propellus Maximus
Posts: 6365
Joined: Mon Mar 05, 2007 8:33 am

Re: External Stylesheet and Bootstrap Usage

Post by NorthEast »

Adding this to the Toolbar Custom JavaScript in a tripane skin just makes it available in the skin frames, not the topics.
So I take it you're trying to use bootstrap in the skin frames?

You can certainly append CSS script links this way (I wrote a blog post about it here), but I'm pretty sure appending a script to the head will not work (or at least the script may be added, but not actually run).

So why not just copy/paste the bootstrap script into the custom javascript section?
Then it'll be included and run with your output.
Post Reply