Would it be possible to merge the "previous" and "next" links with the main navigation that has the "recent entries"/"read page"/"tags", etc links in it?
The end result I am looking for is a header navigation that goes in this order:
previous | recent entries | archive | read | tags | info | next
I would prefer if the previous/next links only show up if there are actually entries before/afterward.
I hope that was clear enough! Thanks in advance.
The end result I am looking for is a header navigation that goes in this order:
previous | recent entries | archive | read | tags | info | next
I would prefer if the previous/next links only show up if there are actually entries before/afterward.
I hope that was clear enough! Thanks in advance.
no subject
Date: 2012-12-21 12:15 am (UTC)# code by ninetydegrees/foxfirefey function print_module_navlinks() { var Page p = get_page(); var string prev_link; var string next_link; if ( $p isa EntryPage ) { var EntryPage ep = get_page() as EntryPage; var Entry e = $ep.entry; var Link prev = $e->get_link("nav_prev"); $prev_link = """<a href="$prev.url">$prev.caption</a>"""; var Link next = $e->get_link("nav_next"); $next_link = """<a href="$next.url">$next.caption</a>"""; } elseif ( $p isa DayPage ) { var DayPage dp = get_page() as DayPage; $prev_link = """<a href="$dp.prev_url">$*text_day_prev</a>"""; $next_link = """<a href="$dp.next_url">$*text_day_next</a>"""; } elseif ( $p isa RecentPage ) { var RecentPage rp = get_page() as RecentPage; if ( $rp.nav.backward_count > 0 ) { $prev_link = """<a href="$rp.nav.backward_url">""" + get_plural_phrase( $rp.nav.backward_count, "text_skiplinks_back" ) + "</a>"; } if ( $rp.nav.forward_count > 0 ) { $next_link = """<a href="$rp.nav.forward_url">""" + get_plural_phrase( $rp.nav.forward_count, "text_skiplinks_forward" ) + "</a>"; } } elseif ( $p isa MonthPage ) { var MonthPage mp = get_page() as MonthPage; if ($mp.prev_url != "") { $prev_link = "<a href='$mp.prev_url'>Previous</a>"; } if ($mp.next_url != "") { $next_link = "<a href='$mp.next_url'>Next</a>"; } } var string[] navlinks_order = []; var string{} navlinks_urls = {}; var string{} navlinks_text = {}; $navlinks_order = [ "userinfo", "tags", "archive", "journals", "communities", "networkpc", ]; $navlinks_urls = { "userinfo" => "$p.base_url/profile", "tags" => "$p.base_url/tag", "archive" => "$p.base_url/calendar", "journals" => "$p.base_url/read?show=P", "communities" => "$p.base_url/read?show=C", "networkpc" => "$p.base_url/network?show=PC", }; $navlinks_text = { "userinfo" => "About", "tags" => "All Tags", "archive" => "Archives", "journals" => "DW People", "communities" => "DW Places", "networkpc" => "DW Plains", }; open_module("navlinks", "", ""); var string[] links = []; if ( $prev_link ) { $links[size $links] = $prev_link; } foreach var string k ($navlinks_order) { if ($navlinks_urls{$k} != "") { var string css = """ class="$k" """; if ($p.view == $k) { $css = """ class="current $k" """; } $links[size $links] = """<a href="$navlinks_urls{$k}"$css>$navlinks_text{$k}</a>"""; } } if ( $next_link ) { $links[size $links] = $next_link; } print_module_list($links); close_module(); }no subject
Date: 2012-12-21 01:29 am (UTC)(And yeah, so my hunch was right - couldn't imagine what else it was.)
ETA: worked like a charm - and you wrote that up really quick.