Hi Nabble Team,
We would like to add Next and Previous navigation buttons to our message threads. See the image below for an example. (circled in orange). It would be nice to have the option of using a graphic button, but worse case we could simply use text. Can you please tell us how we can accomplish this using NAML or other approach. Thank you, Mark |
Please, add this code in your advanced naml editor:
<override_macro name="topic_controls_right" requires="forum_topic_namespace"> <n.pin_icon/> <n.lock_icon/> <n.message_count/> <img src="/images/gear.png" class="image16" alt="[t]Options[/t]"/> <n.page_node.topic_dropdown/> <n.comment.>Added Prev and next topic links</n.comment.> <n.prev_topic/> | <n.next_topic/> </override_macro> <macro name='next_topic'> <n.page_node.get_app_node.children_list. start="[n.app_index_record/]" length="[n.app_rows_per_page/]" filter="[n.app_topic_filter/]" sort="[n.if.app_is_by_priority][then]priority[/then][else]pinned-and-last-node-date[/else][/n.if.app_is_by_priority]" > <n.comment.>Added Next Topic links</n.comment.> <n.loop.> <n.if.equal value1="[n.current_node.id/]" value2="[n.page_node.id/]"> <then> <n.if.next_node> <then> <a href="[n.current_node.url/]">Next Topic</a> </then> <else> <t>Next Topic</t> </else> </n.if.next_node> </then> </n.if.equal> </n.loop.> </n.page_node.get_app_node.children_list.> </macro> <macro name='prev_topic'> <n.page_node.get_app_node.children_list. start="[n.app_index_record/]" length="[n.app_rows_per_page/]" filter="[n.app_topic_filter/]" sort="[n.if.app_is_by_priority][then]priority[/then][else]pinned-and-last-node-date[/else][/n.if.app_is_by_priority]" > <n.comment.>Added Prev Topic link</n.comment.> <n.loop.> <n.if.equal value1="[n.current_node.id/]" value2="[n.page_node.id/]"> <then> <a href="[n.var name='last_url'/]">Prev Topic </a> </then> </n.if.equal> <n.set_var. name='last_url'><n.current_node.url/></n.set_var.> </n.loop.> </n.page_node.get_app_node.children_list.> </macro>Let me know if it works, so that we can customize.
My test forum.
|
This post was updated on .
Pedro,
Two things (see graphic below): 1. I was actually looking for a way to add buttons to move to the next/previous page of messages, NOT topics. I know we already have the page numbers, but I would like to give our customers a basic forward or back arrow; many find this easier than clicking on the numbers. I think a graphic will be better than text so that they dont confuse it with the topics next/previous links above. See my mockup below, we can do something like this (we can provide the graphics). There is a little intelligence we would have to add - Notice in image #1 that only the Next arrow shows (because there is not previous page), notice in image #2 that both previous and next arrows show (because you can now go back or forward, and finally notice in image #3 that only the back arrow shows (because you are at the last page) 2. I like your previous and next topic code. I did find an error however. See in image #2 and #3 below. the words "Prev Topic | Next Topic" do not appear once you go beyond one page. |
Please, try this code:
<override_macro name="generic_paging" requires="paging" parameters="margin,url"> <n.if.has_paging> <then> <n.put_in_head.> <style type="text/css"> span.current-page { padding: .1em .4em; } span.page { padding: .1em; } span.pages a { padding: .1em .4em; } span.current-page { border-width:1px; border-style:solid; } span.pages { float:right; white-space:nowrap; font-weight:normal; } </style> </n.put_in_head.> <span class="pages" style="padding:[n.margin/]"> <n.if.has_next_page> <then> <a href="[n.current_page.next_page.url/]">Next »</a> </then> </n.if.has_next_page> </span> <n.remove_spaces_between_tags.> <span class="pages" style="padding:[n.margin/]"> <n.if.not.is_at_beginning> <then> <n.first_page.link url="[n.url/]" /> ... </then> </n.if.not.is_at_beginning> <n.neighboring_pages.show url="[n.url/]" /> <n.if.not.is_at_end> <then> ... <n.last_page.link url="[n.url/]" /> </then> </n.if.not.is_at_end> </span> </n.remove_spaces_between_tags.> <span class="pages" style="padding:[n.margin/]"> <n.if.has_previous_page> <then> <a href="[n.current_page.previous_page.url/]">« Prev </a> </then> </n.if.has_previous_page> </span> </then> </n.if.has_paging> </override_macro>
My test forum.
|
Works great. Thank you.
|
In reply to this post by Pedro
Piggy Backing on this topic. Would something like this be possible for the Prev / Next Topics? The same problem exists on page 2, 3, etc. of the list of topics - the Prev Topic and Next Topic aren't there. It only currently works for the first page worth of topics.
Coleen |
Please, change your both macros prev_topic , next_topic. You should replace your code with this:
<n.page_node.get_app_node.children_list. start="0" length="[n.app_rows_per_page/]" filter="[n.app_topic_filter/]" sort="[n.if.app_is_by_priority][then]priority[/then][else]pinned-and-last-node-date[/else][/n.if.app_is_by_priority]" >In both macros the "start" attribute should be 0. Let me know if it works.
My test forum.
|
No, I still don't see the Next Topic / Prev Topic links when I'm on page 2 or higher in the list of topics in a subforum.
Coleen |
Please, give a topic where the links don't appear at page 2 or higher.
My test forum.
|
All of them starting on page 2. But here is one: http://forum.sudsol.org/Fall-Fest-td13009.html What would really be nice is to start anywhere, select a topic and be able to continue to scroll forward or backwards through the topics regardless of page boundaries. -Coleen Coleen Astalos, Stampin' Up! Demonstrator From: Pedro <Nabble> [via Nabble Support] [mailto:[hidden email]] Please, give a topic where the links don't appear at page 2 or higher. My test forum. If you reply to this email, your message will be added to the discussion below: http://support.nabble.com/Help-with-Next-Previous-Page-Navigation-tp7591233p7591338.html To unsubscribe from Help with Next / Previous Page Navigation, click here. |
Thanks, now I see.
I've made some changes in your forum. Please, take a look.
My test forum.
|
Perfect. Thanks! Coleen Coleen Astalos, Stampin' Up! Demonstrator From: Pedro <Nabble> [via Nabble Support] [mailto:[hidden email]] Thanks, now I see. My test forum. If you reply to this email, your message will be added to the discussion below: http://support.nabble.com/Help-with-Next-Previous-Page-Navigation-tp7591233p7591369.html To unsubscribe from Help with Next / Previous Page Navigation, click here. |
Free forum by Nabble | Edit this page |