Reputation: 28944
Take the tutorial YABE as example, in the CRUD, for Post, it can show its related tags, but it can not show its related comments. So how can I let it show its related comments ?
Thanks.
Upvotes: 2
Views: 175
Reputation: 4896
The CRUD module only shows bi-directional relationships in one of the two entities: the one that does not have the mappedBy attribute.
Use the custom tag if you need to.
Something like:
<div id="crudListTable">
#{crud.table fields:['name','description','comments']}
#{crud.custom 'description'}
#{if object.description}${object.description.length() > 50 ? object.description[0..50] + '…' : object.description}#{/if}
#{/crud.custom}
#{crud.custom 'comments'}
#{list items:object.comments, as:'comment'}
${comment.description} /
#{/list}
#{/crud.custom}
#{/crud.table}
</div>
Upvotes: 1