Thanks.
Assuming the names of the three related templates are - gallery.php, exhibitions.php and collectors.php, following is what you should do.
Define the following regions in gallery.php
While editing an image (gallery page), you should now see a multi-select checkboxes list for exhibitions and a single-select dropdown for collectors.
To display the related pages on the various templates, following sample code should help you -
gallery.php:
exhibitions.php:
collectors.php
Hope it helps.
Assuming the names of the three related templates are - gallery.php, exhibitions.php and collectors.php, following is what you should do.
Define the following regions in gallery.php
- Code: Select all
<cms:editable type='relation' label='Exhibitions' name='image_exhibitions' has='many' masterpage='exhibitions.php' />
<cms:editable type='relation' label='Collectors' name='image_collectors' has='one' masterpage='collectors.php' />
While editing an image (gallery page), you should now see a multi-select checkboxes list for exhibitions and a single-select dropdown for collectors.
To display the related pages on the various templates, following sample code should help you -
gallery.php:
- Code: Select all
<cms:if k_is_page >
<!-- All variables of 'gallery.php' are available here -->
<h2>Image: <cms:show k_page_title /></h2>
<h3>Related exhibitions:</h3>
<cms:related_pages 'image_exhibitions' >
<!-- All variables of 'exhibitions.php' are available here -->
<cms:show k_page_title /><br/>
</cms:related_pages>
<h3>Related collectors:</h3>
<cms:related_pages 'image_collectors' >
<!-- All variables of 'collectors.php' are available here -->
<cms:show k_page_title /><br/>
</cms:related_pages>
</cms:if>
exhibitions.php:
- Code: Select all
<cms:if k_is_page >
<!-- All variables of 'exhibitions.php' are available here -->
<h2>Exhibition: <cms:show k_page_title /></h2>
<h3>Related images:</h3>
<cms:reverse_related_pages 'image_exhibitions' masterpage='gallery.php' >
<!-- All variables of 'gallery.php' are available here -->
<cms:show k_page_title /><br/>
</cms:reverse_related_pages>
</cms:if>
collectors.php
- Code: Select all
<cms:if k_is_page >
<!-- All variables of 'collectors.php' are available here -->
<h2>Collector: <cms:show k_page_title /></h2>
<h3>Related images:</h3>
<cms:reverse_related_pages 'image_collectors' masterpage='gallery.php' >
<!-- All variables of 'gallery.php' are available here -->
<cms:show k_page_title /><br/>
</cms:reverse_related_pages>
</cms:if>
Hope it helps.