Overwrite the rendering of a field

27 views
Skip to first unread message

dsm...@cartel.nl

unread,
Feb 19, 2014, 2:04:51 AM2/19/14
to symfony2adm...@googlegroups.com
Hi people,

As mentioned in the Documentation:

Edit the file : YourBundle/Resources/views/List/index.html

And for the column title overwrite the Twig Block named list_td_column_title

{% extends_admingenerated "NamespaceYourBundle:List:index.html.twig" %}
{% block list_td_column_title %}
    <span style="font-weight:bold">{{ Movie.title }}</span>
{% endblock %}

My issue:

No matter what I do, I can't get AdminGeneratorBundle to overwrite the 'title' field. It doesn't look like rocketscience to me, but it does not render!
I have even altered the row.html.twig so it made me show the block name in a special attribute. "list_td_column_title" is correct.

Can someone tell me what I am doing wrong? Is it a bug? I'm lost!

DOES NOT WORK:
{% block list_td_column_title %}
test
{% endblock %}
 ""
DOES WORK:
{% block body %}
This is a test!
{% endblock %}

The Page-generator.yml:
generator: admingenerator.generator.doctrine
params:
    model: Cartel\PrivateLeaseBundle\Entity\Page
    namespace_prefix: Cartel
    concurrency_lock: ~
    bundle_name: PrivateLeaseAdminBundle
    pk_requirement: ~
    fields:
        id: { label: '#' }
        title: { label: Titel }
        slug: { label: Browser vriendelijke url }
        meta_title: { label: SEO Titel }
        meta_keywords: { label: SEO Zoekwoorden }
        meta_description:
            label: SEO Omschrijving
            formType: textarea
        content:
            label: Inhoud
            formType: textarea
        sequence: { label: Volgorde }
        in_footer: { label: Tonen in voetmenu }
        createdAt: { label: Aangemaakt op }
        updatedAt: { label: Aangepast op }
        removedAt: { label: Verwijderd op }
# max_per_page: 20
    sort: [ sequence, ASC ]
    object_actions:
        delete: ~
    batch_actions:
        delete: ~
builders:
    list:
        params:
            title: List for PrivateLeaseAdminBundle
            display: [id, site, title, slug, content, in_footer, sequence]
            actions:
                new: { label: Nieuwe pagina }
            object_actions:
                show: ~
                edit: ~
                delete: ~
    filters:
        params:
            display: [title, slug, meta_title, meta_keywords, in_footer]
    new:
        params:
            title: Nieuwe pagina
            display:
                "Website": [site]
                "Algemeen": [title, content]
                "SEO": [meta_title, meta_keywords, meta_description]
                "Opties": [sequence, in_footer]
            actions:
                save: { label: Opslaan }
                list: { label: Terug }
    edit:
        params:
            title: "Pagina aanpassen: \"%object%\"|{ %object%: Page }|"
            display:
                "Website": [site]
                "Algemeen": [title, content]
                "SEO": [meta_title, meta_keywords, meta_description]
                "Opties": [sequence, in_footer]
            actions:
                delete: { label: Verwijderen }
                save: { label: Opslaan }
                list: { label: Terug }
    show:
        params:
            title: "Pagina informatie: \"%object%\"|{ %object%: Page }|"
            display:
                "Website": [site]
                "Algemeen": [title, content]
                "SEO": [meta_title, meta_keywords, meta_description]
                "Opties": [sequence, in_footer]
                "Extra": [createdAt, updatedAt, removedAt]
            actions:
                new: { label: Nieuwe Pagina }
                delete: { label: Verwijderen }
                list: { label: Terug }
    actions:
        params:
            object_actions:
                delete: ~
            batch_actions:
                delete: ~


Kind regards,

Dennis

Cédric Lombardot

unread,
Feb 19, 2014, 2:55:36 AM2/19/14
to Symfony2 Admingenerator bundles support for users

Hi to find good names take a look in your cache Admingenerated folder.

Cedric

--
--
You received this message because you are subscribed to the Google
Groups "Symfony2 Admingenerator bundles support for users" group.
To post to this group, send email to
symfony2adm...@googlegroups.com
To unsubscribe from this group, send email to
symfony2admingene...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony2admingenerator?hl=en
 
---
Found bundle documentation at http://symfony2admingenerator.org/
 
---
You received this message because you are subscribed to the Google Groups "Symfony2 Admingenerator bundles support for users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to symfony2admingene...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

dsm...@cartel.nl

unread,
Feb 19, 2014, 3:06:47 AM2/19/14
to symfony2adm...@googlegroups.com
Cedric,

{% block list_td_column_title %}{{ Page.title }}{% endblock list_td_column_title %}

So, the blockname is correct. But I just now, got it figured out I guess, edit the row.html.twig instead of the index.html.twig
I don't know if this is the way to go? 

Kind regards,

Dennis

Op woensdag 19 februari 2014 08:55:36 UTC+1 schreef cédric LOMBARDOT:

For more options, visit this group at
http://groups.google.com/group/symfony2admingenerator?hl=en
 
---
Found bundle documentation at http://symfony2admingenerator.org/
 
---
You received this message because you are subscribed to the Google Groups "Symfony2 Admingenerator bundles support for users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to symfony2admingenerator+unsub...@googlegroups.com.

Cédric Lombardot

unread,
Feb 19, 2014, 3:09:24 AM2/19/14
to Symfony2 Admingenerator bundles support for users

Yes it should be the same file name as in cache doc is not up to date we havve split files after

Cedric


For more options, visit this group at
http://groups.google.com/group/symfony2admingenerator?hl=en
 
---
Found bundle documentation at http://symfony2admingenerator.org/
 
---
You received this message because you are subscribed to the Google Groups "Symfony2 Admingenerator bundles support for users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to symfony2admingene...@googlegroups.com.

dsm...@cartel.nl

unread,
Feb 19, 2014, 3:17:21 AM2/19/14
to symfony2adm...@googlegroups.com
Thanks a whole lot Cédric,

But doesn't that mean that the documentation should be rewritten? It clearly says:
# Edit the file : YourBundle/Resources/views/List/index.html

And then please excuse me for not using common sense :D
I am fairly new to both Symfony 2 and AdminGeneratorBundle, so this maybe confusing for newbies.

Kind regards 
Dennis Smink

Op woensdag 19 februari 2014 09:09:24 UTC+1 schreef cédric LOMBARDOT:

For more options, visit this group at
http://groups.google.com/group/symfony2admingenerator?hl=en
 
---
Found bundle documentation at http://symfony2admingenerator.org/
 
---
You received this message because you are subscribed to the Google Groups "Symfony2 Admingenerator bundles support for users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to symfony2admingenerator+unsubscri...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

Cédric Lombardot

unread,
Feb 19, 2014, 3:53:02 AM2/19/14
to Symfony2 Admingenerator bundles support for users
I've fixed the website site must be regenerated in 5 minutes.




For more options, visit this group at
http://groups.google.com/group/symfony2admingenerator?hl=en
 
---
Found bundle documentation at http://symfony2admingenerator.org/
 
---
You received this message because you are subscribed to the Google Groups "Symfony2 Admingenerator bundles support for users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to symfony2admingene...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages