Skip to content
This repository was archived by the owner on Apr 12, 2020. It is now read-only.

Latest commit

 

History

History
55 lines (39 loc) · 1.39 KB

File metadata and controls

55 lines (39 loc) · 1.39 KB

Extending Gitonomy GitBundle

OK, now you're using this bundle and are happy with it. Great. But how to override things to get more specific views?

Well good news, everything is meant to be overriden.

Override templating

If you want to change the way blocks are rendered, create a new template file and start writing blocks in it, like in Resources/views/default_theme.html.twig.

Here is an example:

{% block author %}
{% spaceless %}
    <span class="git-author">
        {{- name -}}
    </span>
{% endspaceless %}
{% endblock %}

Symfony2

When you created this file, you need to inject it in GitExtension. If you are using the bundle, you can add it to configuration:

gitonomy_twig:
    twig_extension:
        enabled: true
        themes:
            - AcmeDemoBundle::my_theme.html.twig
            - GitonomyGitBundle::default_theme.html.twig

Raw integration

If you are using the Twig extension as standalone, you need to change the second parameter of the constructor:

$extension = new GitExtension($urlGenerator, array(
    'my_theme.html.twig',
    '@GitonomyGitBundle/default_theme.html.twig',
));

See documentation on raw integration for more informations.