Forum for discussing general topics related to Couch.
2 posts Page 1 of 1
I have a template - courses.php which has a relationship with course-details.php

courses.php

Code: Select all
<cms:editable 
        type='reverse_relation'
        name='course_details'
        masterpage='course-details.php'
        field='details_course'
        anchor_text='&blacktriangleright; CLICK HERE to go to COURSE DETAILS'
        label='&nbsp;'
        desc=''   
    /> 


course-details.php

Code: Select all
 
    <cms:editable
        type='relation'
        name='details_course'
        masterpage='courses.php'
        has='one'
        no_gui='1'
        label='&nbsp;'
    /> 

Within the admin panel when creating a course the user can decide whether to create further course details and click through to the course-details.php template.

Front-end: when viewing a course - in page view, I want to display some details from courses.php and also to have sub-navigation for each of the related course-details.php. So on clicking a sub-navigation link the page view of courses.php is maintained while the details of the selected course-details.php is displayed on the page.

However ... I've more or less decided that I can't achieve this, and that I will have to use a feature of UIKit called Switcher to transition through content panes. Am I right in thinking that related pages can't be used in this way?
So on clicking a sub-navigation link the page view of courses.php is maintained while the details of the selected course-details.php is displayed on the page.

It would really depend on how you choose to code the front-end e.g. if the details page is a separate URL you can additionally display data of the main course on that page.

Alternatively, use only the main course page and show the details also on the same page - the sub-links could use AJAX to fetch details and modify the main page. Or, if the details are not too voluminous, just put all that data at once on the main page and use JS to show/hide it selectively (which is what the 'switcher' you mentioned essentially does).
2 posts Page 1 of 1
cron