Use bootstrap3 with datatables - Page 2

Use bootstrap3 with datatables

2»

Answers

  • allanallan Posts: 63,096Questions: 1Answers: 10,390 Site admin

    It sounds like a routing issue with your web server. Are you sure that node_modules is in your web path? What are you using as your web server?

    Allan

  • Arden54Arden54 Posts: 39Questions: 4Answers: 0

    I'm using firefox and google chrome. Yes it is, but I have two node_modules. One in the web folder and another one in project directly ( arborescence : project => bin, src, app, web=>node_modules library root, node_module, tests, var....)

    But each files for bootstrap are in the node_modules from the web folder.

  • allanallan Posts: 63,096Questions: 1Answers: 10,390 Site admin

    Can you open a terminal and type curl -i {url} - replacing {url} with the exact URL that the browser is trying to load the style sheet from please? What does the output show?

    Allan

  • Arden54Arden54 Posts: 39Questions: 4Answers: 0

    I tried, nothing appear, syntax error, can't use curl -i.

  • pdugaspdugas Posts: 13Questions: 4Answers: 2
    Answer ✓

    Standard guidance from Symfony is to use other tools to manage front-end code and put the results into the web/ directory. I personally use npm like you pulling various libraries into the node_modules/ directory. I then use Grunt with less and uglify to build web/js/lib.js and web/css/lib.css - I merge jQuery, DataTables, etc. into these two files. My base twig template then has <link href="{{ asset('css/lib.css') }}" rel="stylesheet"> and <script src="{{ asset('js/lib.js') }}"></script> in the right places. Works great.

  • allanallan Posts: 63,096Questions: 1Answers: 10,390 Site admin

    can't use curl -i

    Do you have curl installed?

    Sounds like @pdugas's advise is the way to go.

    Allan

  • pdugaspdugas Posts: 13Questions: 4Answers: 2

    I'll add that getting the right .js and .css/.less files pulled together in the correct order was much clearer when I looked at https://datatables.net/download/ and select the Individual Files option near the bottom. I just mimicked the Package Results section in my Gruntfile using the node_modules/ content instead.

  • Arden54Arden54 Posts: 39Questions: 4Answers: 0

    Indeed @pdugas, It's what I would like to do. However, after have downloadead the .js and .css I can't place them together in the correct order in my base twig template since the result of the web page isn't in bootstrap. I followed the advice from the site but no issues.

  • Arden54Arden54 Posts: 39Questions: 4Answers: 0

    UP, finally resolved. Forgot to put this:

    class="table table-striped table-bordered" 
    

    and to download bootstrap3 in my project, so was a bit difficult to make it right lol.. feel a bit stupid ^^

    Thanks everyone for your help, awesome plugin you did, great works. Have a nice day :smile:

This discussion has been closed.