Navigate from Topic to Topic?

classic Classic list List threaded Threaded
33 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Navigate from Topic to Topic?

Coleen_Astalos
In a nabble forum, is it possible to navigate from one topic to the next to topic without having to go back to the subcategory first?   Something like "next topic" and "previous topic" links so you can quickly go thru all the topics in a subcategory one by one without having to go back to the subcategory page.
Coleen
Reply | Threaded
Open this post in threaded view
|

Re: Navigate from Topic to Topic?

GregChapman
I would very much welcome this feature too - particularly for the "Gallery" application, where navigating a sequence of images posted to different topics is a pain!
Just a Volunteer Nabble Helper - because the nice folk at Nabble have helped me!
GregHelp - Building a set of answers to Nabble FAQs.
Reply | Threaded
Open this post in threaded view
|

Re: Navigate from Topic to Topic?

Pedro <Nabble>
Please, try this code for the next topic:
<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.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.loop.>
            <n.current_node.id/>
        </n.loop.>
    </n.page_node.get_app_node.children_list.>
</macro>
I didn't test it a lot, so you may find some missing details/issues.
My test forum.
Reply | Threaded
Open this post in threaded view
|

Re: Navigate from Topic to Topic?

GregChapman
I think I have added that code correctly but see no change in behaviour to my forum at:
http://seahawk-forum.968426.n3.nabble.com/Gallery-f1624462.html

It required an edit to the first macro and a new file for the second inserted via the advanced editor. Is that right?

You are in the "Moderator" group on that forum so should be able to view it and see if it is behaving as you expect. (Others will not be able to see it.)
Just a Volunteer Nabble Helper - because the nice folk at Nabble have helped me!
GregHelp - Building a set of answers to Nabble FAQs.
Reply | Threaded
Open this post in threaded view
|

Re: Navigate from Topic to Topic?

Pedro <Nabble>
Sorry, I had posted the wrong code for the new macro. Try this:
<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.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>
                    </n.if.next_node>                        
                </then>  
            </n.if.equal>
            
        </n.loop.>
    </n.page_node.get_app_node.children_list.>
</macro>
My test forum.
Reply | Threaded
Open this post in threaded view
|

Re: Navigate from Topic to Topic?

GregChapman
I've replaced that macro and can see, from the code, that a "Next Topic" link should be appearing - but that's not happening on my gallery. :-(
Just a Volunteer Nabble Helper - because the nice folk at Nabble have helped me!
GregHelp - Building a set of answers to Nabble FAQs.
Reply | Threaded
Open this post in threaded view
|

Re: Navigate from Topic to Topic?

Pedro <Nabble>
That works for forums and other types. I will do it for your gallery.
My test forum.
Reply | Threaded
Open this post in threaded view
|

Re: Navigate from Topic to Topic?

Pedro <Nabble>
In reply to this post by GregChapman
Take a look now.
My test forum.
Reply | Threaded
Open this post in threaded view
|

Re: Navigate from Topic to Topic?

GregChapman
In reply to this post by Pedro <Nabble>
On a gallery it would also be conventional to have a "Previous" link too!
Just a Volunteer Nabble Helper - because the nice folk at Nabble have helped me!
GregHelp - Building a set of answers to Nabble FAQs.
Reply | Threaded
Open this post in threaded view
|

Re: Navigate from Topic to Topic?

Pedro <Nabble>
I agree, that is the next step.
My test forum.
Reply | Threaded
Open this post in threaded view
|

Re: Navigate from Topic to Topic?

GregChapman
In reply to this post by Pedro <Nabble>
It's after midnight here and I'm on my way to bed.

In a very quick test I've found no problems.

There's various things to do to make it look prettier, but as a proof of concept for the basic code it looks like you've cracked it.

For example, I love the blue arrowhead scroll buttons that show on the gallery on the root page. It would be good to use them for moving from topic to topic.
Just a Volunteer Nabble Helper - because the nice folk at Nabble have helped me!
GregHelp - Building a set of answers to Nabble FAQs.
Reply | Threaded
Open this post in threaded view
|

Re: Navigate from Topic to Topic?

Coleen_Astalos
In reply to this post by GregChapman
Works great on the forum!  Now just waiting for the "previous topic" to be able to add it as well.
Thanks,
Coleen
Reply | Threaded
Open this post in threaded view
|

Re: Navigate from Topic to Topic?

Pedro <Nabble>
Please, try this for the previous topic:
<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.next_topic/>
    <n.prev_topic/>
</override_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.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>
My test forum.
Reply | Threaded
Open this post in threaded view
|

Re: Navigate from Topic to Topic?

GregChapman
This post was updated on .
Tried to add the "prev_topic" macro (and the change to topic_controls_right) but I still don't see a Previous Topic link.

LATER EDIT: As Coleen says it's working I guess this is another case where the Gallery app code needs to be slightly different?
Just a Volunteer Nabble Helper - because the nice folk at Nabble have helped me!
GregHelp - Building a set of answers to Nabble FAQs.
Reply | Threaded
Open this post in threaded view
|

Re: Navigate from Topic to Topic?

Coleen_Astalos
In reply to this post by Pedro <Nabble>
Thanks.  That works in the Forum.
Coleen
Reply | Threaded
Open this post in threaded view
|

Re: Navigate from Topic to Topic?

Coleen_Astalos
Only two problems I'm seeing:
1) When I go to page 2 or higher  of the list of topics in a subcategory and click on a topic, the Prev Topic, Next Topic links don't show.    But the bar I added (see below) does show.  So it's executing that code, but perhaps doesn't have a value for those links  

2) When at the last topic in the thread the "Next Topic" is not shown (similar to what I'm seeing above).  Whereas when at the first topic, the "Prev Topic" is shown, it's just not an active link (this is preferable).

I added a bar | in between the prev topic and next topic to separate them a bit:
<override_macro name="topic_controls_right" requires="forum_topic_namespace">
    <n.pin_icon/>
    <n.lock_icon/>
    <n.message_count/>
    
    <n.page_node.topic_dropdown/>
    <n.prev_topic/> | 
    <n.next_topic/>
</override_macro> 

And so if the "Next Topic" words aren't there because it's the last message,  then it looks funny.

Thanks!
Coleen
Reply | Threaded
Open this post in threaded view
|

Re: Navigate from Topic to Topic?

Pedro <Nabble>
I know, that happens because I use the same loop that generates the parent app to navigate through the nodes. If you change your pagination it may also change too.
I will think in a generic solution.
My test forum.
Reply | Threaded
Open this post in threaded view
|

Re: Navigate from Topic to Topic?

GregChapman
Hi Pedro,

I see you've now got the "Next/Previous" links working on my SeaHawk forum too. Thanks for your efforts. However, apart from the issues Coleen mentions, I have another...

I was only looking for this feature on the "Gallery" app within that forum. Currently it's hidden for ordinary users, as I haven't felt it works as a gallery properly without those links. That's why I was happy for it to be used as a suitable vehicle for testing.

However, as it stands, the new links appear throughout the forum. Is there an easy way to restrict it to just the gallery?
Just a Volunteer Nabble Helper - because the nice folk at Nabble have helped me!
GregHelp - Building a set of answers to Nabble FAQs.
Reply | Threaded
Open this post in threaded view
|

Re: Navigate from Topic to Topic?

GregChapman
Hi Pedro,

In the flood of work you've got caught up in recently the question in the previous post in this topic seems to have got lost.

Hope you can find the time to provide an answer?
Just a Volunteer Nabble Helper - because the nice folk at Nabble have helped me!
GregHelp - Building a set of answers to Nabble FAQs.
Reply | Threaded
Open this post in threaded view
|

Re: Navigate from Topic to Topic?

Pedro <Nabble>
In reply to this post by GregChapman
GregChapman wrote
However, as it stands, the new links appear throughout the forum. Is there an easy way to restrict it to just the gallery?
Take a look at your advanced naml editor. I put everything related to this at the next_prev_file.
The first override controls your gallery, so you can add the n.prev_topic there.
The second is for your forum. You can remove it for have the links out of your forum.
My test forum.
12