This topic contains 3 replies, has 2 voices, and was last updated by Mike Kudelya 7 years, 4 months ago.
- Topic
Hi,
I have Timetable Entity. In timetable view detail, I want to display detail about Course and Lesson related to it.
This is my code12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879{% if resource_granted('phs_school_lesson_view') %}{% set widgetContent %}{{ oro_widget_render({'widgetType': 'block','url': path('oro_attachment_widget_attachments', {entityClass: oro_class_name(entity.lesson, true),entityId: entity.lesson.id}),'title': 'oro.attachment.entity_plural_label'|trans,'cssClass': 'list-widget',}) }}{% endset %}{%- set lessonInformation -%}<div class="row-fluid form-horizontal"><div class="responsive-block">{{ UI.renderProperty('Label'|trans, entity.lesson.label) }}{{ UI.renderHtmlProperty('Description'|trans, entity.lesson.description) }}{{ UI.renderProperty('Duration'|trans, entity.lesson.duration) }}{{ UI.renderProperty('Course'|trans, entity.course) }}</div></div>{%- endset -%}{% set dataBlocks = dataBlocks|merge([{'title': 'phs.school.lesson.menu_label'|trans,'subblocks': [{'title': 'Lesson Infomation','data': [lessonInformation]},{'title': '','data': [widgetContent]}]}]) %}{% endif %}{% if resource_granted('phs_school_course_view') %}{% set widgetCourseContent %}{{ oro_widget_render({'widgetType': 'block','url': path('oro_attachment_widget_attachments', {entityClass: oro_class_name(entity.course, true),entityId: entity.course.id}),'title': 'oro.attachment.entity_plural_label'|trans,'cssClass': 'list-widget',}) }}{% endset %}{%- set courseInformation -%}<div class="row-fluid form-horizontal"><div class="responsive-block">{{ UI.renderProperty('Label'|trans, entity.course.label) }}{{ UI.renderHtmlProperty('Description'|trans, entity.course.description) }}</div></div>{%- endset -%}{% set dataBlocks = dataBlocks|merge([{'title': 'phs.school.course.menu_label'|trans,'subblocks': [{'title': 'Course Infomation','data': [courseInformation]},{'title': '','data': [widgetCourseContent]}]}]) %}{% endif %}It will display some basic information and attachment of Course and Lesson in Timetable.
But the problem is, 2 blocks Attachment is the same, I mean in Course detail, it displays the attachment from Lesson, although I set different entityClass for oro_attachment_widget_attachments.
Anyone got this problem, and do you have any ideal? Thanks for read.
The forum ‘OroPlatform – How do I? Questions’ is closed to new topics and replies.