Bootstrap example app

101 views
Skip to first unread message

Ivo Pereira

unread,
Apr 22, 2014, 7:39:21 AM4/22/14
to terrific...@googlegroups.com
Hello,

After a while, I found out that I didn't need to use all the composer to create an application, and I could do it with just Bootstrap (that was really what I was looking after).

However I am struggling to get a simple working application.

I have the following in my index.html:

<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
    <head>
        <meta charset="utf-8">

        <link rel="stylesheet" href="css/normalize.min.css">
        <link rel="stylesheet" href="css/main.css">

        <script src="js/vendor/modernizr-2.6.2.min.js"></script>
    </head>
    <body>

<div class="mod mod-logo">
test
</div>

        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
        <script>window.jQuery || document.write('<script src="js/vendor/jquery-1.11.0.min.js"><\/script>')</script>

        <script src="js/vendor/terrific-2.0.2.min.js"></script>
        <script>
(function($) {
$(document).ready(function() {
var $page = $('body');
var application = new Tc.Application($page);
application.registerModules();
application.start();
});
})(Tc.$);
        </script>
    </body>
</html>


Folder/files structure:
- root
-- css
--- main.css
--- normalize.min.css
--- dependencies
---- logo.css
-- js
--- vendor
---- jquery-1.11.0.min.js
---- modernizr-2.6.2.min.js
---- terrific-2.0.2.min.js
--- dependencies
---- Tc.Module.Logo.js
--- index.html

In the console there appears to be no errors, however it seems to not be loading the module.

Any ideas?

Thanks.

Remo Brunschwiler

unread,
Apr 22, 2014, 8:23:53 AM4/22/14
to terrific...@googlegroups.com
Hi Ivo

Exactly, you don't need the composer at all to just build frontends – the composer is more like a solid base for building applications on it. 
Btw: Have a look at https://github.com/rogerdudler/terrific-micro if you are looking for a more simplistic terrific approach.

To your question:
Terrific doesn't do any lazy loading stuff – there are other micro-libs out there that helps you with this – it does only instantiate the right modules for you. So to make your above example working you have to include Tc.Module.Logo.js as well. Terrific-micro or composer simply concatenate all of your modules into a single js-file to prevent you from unnecessary work ;-)

Hope this helps

Cheers
Remo

Ivo Pereira

unread,
Apr 22, 2014, 10:05:18 AM4/22/14
to terrific...@googlegroups.com
Hello Remo, thanks for answering.

Right what I thought.

That terrific-micro would oblige me to follow that structure of creating "views" for pages. As I do not want to do it that way, I will try to create my own implementation on a PHP Framework.

Thanks!
Reply all
Reply to author
Forward
0 new messages