courtyen
courtyen

Reputation: 532

MEAN.IO how do I change default template?

I am finding it difficult to figure out how the MEAN.IO stack defines the default.html template used through-out the modules and/or packages. I am trying to change one view to instead used the default.html template, to use one that I define.

Their documentation http://mean.io/#!/docs says they use 'swig' as their templating system. However, I did a file search and inside the templates, I find 5 occurrences of 'swig' and it is only declared in html as text. I do not see where swig is being used, or injected in the back end neither. It should be in the back end. Any ideas? .

Default is the html template that all my other pages use as its parent. I want to change that html for another. Here is what default.html looks like:

<!doctype html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="https://www.facebook.com/2008/fbml" itemscope="itemscope" itemtype="http://schema.org/Product">
{% include '../includes/head.html' %}

<body>
    <div class="navbar navbar-default navbar-fixed-top" data-ng-include="'/system/views/header.html'" data-role="navigation"></div>
    {% if adminEnabled %}
    <section class="admin-menu">
        <div data-ng-include="'/mean-admin/views/index.html'"></div>
    </section>
    {% endif %}
    <section class="content">
        <section class="container">
            {% block content %}{% endblock %}
        </section>
    </section>
    {% include '../includes/foot.html' %}
</body>

</html>

Upvotes: 1

Views: 1857

Answers (1)

ron
ron

Reputation: 43

In case anybody else find its way here in hope for an answer: The documentation can be found here: http://learn.mean.io/#mean-stack-packages-overriding-the-default-layouts

From the documentation:

One is able to override the default layout of the application through a custom package. Below is an example overriding the default layout of system and instead using the layouts found locally within the package

MyPackage.register(function(system, app) {
  app.set('views', __dirname + '/server/views');
  // ...

Please note that the package must depend on System to ensure it is evaluated after System and can thus override the views folder

Upvotes: 2

Related Questions