A while ago
ninetydegrees wrote me wonderful code to add Prev/Next links to the navlinks on most pages but I've noticed they're not on the Reply page. I checked here: http://wiki.dwscoalition.org/wiki/index.php/S2_Cookbook:_Modules (where I think someone put the code after giving it to me) but I don't see the specific s2 needed for them to show up there. I'd also like to get them on pages that have their URLs written like: http://mm-writes.dreamwidth.org/123456.html?replyto=123456 (not sure if that falls under the same request or if more s2 would be needed, so thought I'd mention it).
Also, for future s2 coding endeavors, is there any way for me to parse out on my own exactly what variations in the code I would need to do something like this? (When I tried small variations on the existing s2 I got various errors like "Can't find member 'prev_url' in ReplyPage", "Unknown type or class 'Reply'" and so on - I did try everything I could think of variation-wise).
Lastly, I'm trying to get the navlinks bar to a minimum width across the top of the page on all page views - without adding to the existing margins or padding because I'm trying to prevent text wrapping - but I realize the Prev/Next links would not be a good choice/not even be possible to add on say, the Archive and Month (not Day) pages so I want to do custom URLs just on those pages instead. How would I get the custom URLs to show up in the navlinks for just those two pages?
Thanks so much in advance!
Re: For the last qustion I asked in the OP...
Date: 2014-06-23 04:15 pm (UTC)Re: For the last qustion I asked in the OP...
Date: 2014-06-23 11:54 pm (UTC)Thanks again!
Re: For the last qustion I asked in the OP...
Date: 2014-06-24 07:44 pm (UTC)} elseif ( $p isa MonthPage ) {
"<a href='http://www.dreamwidth.org/'>Previous</a>";
"<a href='http://www.dreamwidth.org/'>Next</a>";
}
Re: For the last qustion I asked in the OP...
Date: 2014-06-24 09:54 pm (UTC)Having tried it out, it sort of works but the styling is missing which means it's not falling under navlink territory for some reason. Also, I'm still at a loss on how to add similar code to .page-archive; I keep looking at the link I included in my OP but don't see s2 for that specific page view. I'll keep fiddling with what I've got so far, though; thanks so much again. :)
Re: For the last qustion I asked in the OP...
Date: 2014-06-24 10:00 pm (UTC)Also archive page is YearPage so I think if you do another elseif using this it should work.
Re: For the last qustion I asked in the OP...
Date: 2014-06-24 10:08 pm (UTC)Which works! I'm so happy.
Now just to figure out how to get it onto .page-archive (all I'm missing is the name of the function, like the one I just edited is called Month...)ETA: just read the last sentence again; will give YearPage a shot. Thanks!Re: For the last qustion I asked in the OP...
Date: 2014-06-24 10:12 pm (UTC)S2::NodeVarRef, S2/NodeVarRef.pm, 212
S2::NodeTerm, S2/NodeTerm.pm, 199
S2::NodeTerm, S2/NodeTerm.pm, 68
S2::NodeEqExpr, S2/NodeEqExpr.pm, 49
S2::NodeExpr, S2/NodeExpr.pm, 46
S2::NodeIfStmt, S2/NodeIfStmt.pm, 79
S2::NodeStmtBlock, S2/NodeStmtBlock.pm, 108
S2::NodeIfStmt, S2/NodeIfStmt.pm, 103
S2::NodeStmtBlock, S2/NodeStmtBlock.pm, 108
S2::NodeFunction, S2/NodeFunction.pm, 230
S2::Checker, S2/Checker.pm, 374
S2::Compiler, S2/Compiler.pm, 34
The code used to get that error was this:
Re: For the last qustion I asked in the OP...
Date: 2014-06-24 10:24 pm (UTC)elseif ( $p isa YearPage ) {
$prev_link = "<a href='http://www.dreamwidth.org/'>Previous</a>";
Re: For the last qustion I asked in the OP...
Date: 2014-06-24 10:38 pm (UTC)Re: For the last qustion I asked in the OP...
Date: 2014-06-25 07:59 am (UTC)You're welcome!
Re: For the last qustion I asked in the OP...
Date: 2014-06-25 06:10 pm (UTC)Looking the Core s2 over now, I see I was assuming an inheritance between Entry and Reply, between Recent, Tags and Friends and between Year and Month (not that those last two style the same at all thanks to the variations between tables and definition lists) that does not exist except possibly in their HTML assembly, which might be similar on most of those groups of pages. Thanks for pointing that out. :)