Hi guys,
So far I have two templates, one called 'Author' and the other called Chapter.
In the chapter template, I have actual 'chapter' content for example an editable region called 'Chapter Title' and 'Contents' for the actual contents of that particular chapter.
The Author template simply has a summary and bio of the author.
So my webpage works by letting people choose an author. Once chosen it brings them to a cloned Author page, there Chapter pages that have been related to the author are displayed.
So, I click on Author John Doe and Click on Chapter 2.It loads up Chapter 2 and its contents for me to read. I want to have a next and previous button, I have tried a generic prev and next code but it actually cycles through EVERY chapter from even DIFFERENT authors.
I have related both templates using (this is placed in chapter.php)
Any ideas?
I was originally using this modified snippet from cheesypoof/KK
I've tinkered a little but am not sure how to get it to display properly, it just cycles to every chapter at the moment.
So far I have two templates, one called 'Author' and the other called Chapter.
In the chapter template, I have actual 'chapter' content for example an editable region called 'Chapter Title' and 'Contents' for the actual contents of that particular chapter.
The Author template simply has a summary and bio of the author.
So my webpage works by letting people choose an author. Once chosen it brings them to a cloned Author page, there Chapter pages that have been related to the author are displayed.
So, I click on Author John Doe and Click on Chapter 2.It loads up Chapter 2 and its contents for me to read. I want to have a next and previous button, I have tried a generic prev and next code but it actually cycles through EVERY chapter from even DIFFERENT authors.
I have related both templates using (this is placed in chapter.php)
- Code: Select all
<cms:editable type='relation' name='project_link' masterpage='author.php' has='one' />
Any ideas?
I was originally using this modified snippet from cheesypoof/KK
- Code: Select all
<cms:set cur_page=k_page_name 'global' />
<cms:set prev_page='' 'global' />
<cms:set next_page='' 'global' />
<cms:set found_cur_page='0' 'global' />
<cms:pages skip_custom_fields='1'>
<cms:if found_cur_page=='0' >
<cms:if k_page_name==cur_page >
<cms:set found_cur_page='1' 'global' />
<cms:else />
<cms:set prev_page=k_page_link 'global' />
</cms:if>
<cms:else />
<cms:if next_page==''>
<cms:set next_page=k_page_link 'global' />
</cms:if>
</cms:if>
</cms:pages>
<cms:if prev_page>
<a href="<cms:show prev_page />">Prev</a>
</cms:if>
<cms:if next_page>
<a href="<cms:show next_page />">Next</a>
</cms:if>
I've tinkered a little but am not sure how to get it to display properly, it just cycles to every chapter at the moment.