0

i want to override my user dashboard [profile show.html.twig], but i don't know how to do it. Someone can explain me or show me his code, so i can have an idea how he did it.

this is my show.html.twig:

{% extends "SonataUserBundle:Profile:action.html.twig" %}

{% block sonata_profile_content %}
    {% sonata_template_box 'This is the user profile template. Feel free to override it.' %}

    <div class="row row-fluid">
        {% set has_center = false %}
        {% for block in blocks %}
            {% if block.position == 'center' %}
                {% set has_center = true %}
            {% endif %}
        {% endfor %}

        <div class="{% if has_center %}span4 col-lg-4{% else %}span6 col-lg-6{% endif %}">
            {% for block in blocks %}
                {% if block.position == 'left' %}
                    {{ sonata_block_render({ 'type': block.type, 'settings': block.settings}) }}
                {% endif %}
            {% endfor %}
        </div>

        {% if has_center %}
            <div class="span4 col-lg-4">
                {% for block in blocks %}
                    {% if block.position == 'center' %}
                        {{ sonata_block_render({ 'type': block.type, 'settings': block.settings}) }}
                    {% endif %}
                {% endfor %}
            </div>
        {% endif %}

        <div class="{% if has_center %}span4 col-lg-4{% else %}span6 col-lg-6{% endif %}">
            {% for block in blocks %}
                {% if block.position == 'right' %}
                    {{ sonata_block_render({ 'type': block.type, 'settings': block.settings}) }}
                {% endif %}
            {% endfor %}
        </div>
    </div>
{% endblock %}

Thank you.

Dario
  • 103
  • 1
  • 2
  • 9

1 Answers1

0

You can override the show template in app/Resources/SonataUserBundle/views/Profile/show.html.twig.

You must clear caché at the end

Lumilo
  • 33
  • 8
  • i did override my register and login page it's was very easy. but i don't really understand how to override my profile page, i know that i have to override show.html.twig. can you show me your show.html.twig so i can have an idea how you did it ? – Dario Sep 28 '15 at 06:23
  • I just to see i have the ProfileFOSUser1Controller overrided too. https://github.com/sonata-project/SonataUserBundle/blob/master/Controller/ProfileFOSUser1Controller.php – Lumilo Sep 28 '15 at 06:45