Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Add a link to comments-field (alongside edit)

edited October 2007 in Vanilla 1.0 Help
Heyjo Guys! I got rid of the 'Top of Page' Link (CSS), since I thought that's what the keyboard is good for. My unthankful users disagree. Not only that, they want a 'Top of Page' Link with every single post. (We got looong threads...) You know besides 'edit', 'delete' and stuff. Is there an easy way to accomplish this (edit an existing extension maybe)? Thanks for any hints!


  • Options
    This will probably be easy to modify to do what you want. It's one of the simplest extensions that adds text to the post headers.

    Something like position: fixed in CSS would be cooler... but I can't for the life of me get the right selector...
  • Options
    Ok! Thanks! Now... $Context->Dictionary['Permalink'] = 'permalink'; function CommentGrid_Permalinks(&$CommentGrid) { global $RowNumber; $CommentList = &$CommentGrid->DelegateParameters["CommentList"]; $CommentList .= '<a href="#Item_'. $RowNumber .'" id="Permalink_'. $RowNumber .'">' . $CommentGrid->Context->GetDefinition("Permalink").'</a>'; $RowNumber++; } $RowNumber = 1; $Context->AddToDelegate("CommentGrid", "PostCommentOptionsRender", "CommentGrid_Permalinks"); ?> I probably have to replace the href with #pgtop but I can't quite figure out what parts are dispensable. Can someone please help me?! Me and my guys will be forever grateful. Forever!
  • Options
    This oughta doit: (replacing all the code you posted)
    function CommentGrid_TopOfPage(&$CommentGrid) { $CommentList = &$CommentGrid->DelegateParameters["CommentList"]; $CommentList .= '<a href="#pgtop">' . $CommentGrid->Context->GetDefinition('TopOfPage') .'</a>'; } $Context->AddToDelegate('CommentGrid', 'PostCommentOptionsRender', 'CommentGrid_TopOfPage');
  • Options
    edited October 2007
    Dude! Thank you sooo much, I shall immediately try this! You should release it as a plugin. The awesome Tip-Top-Plugin! EDIT: Works like a charm!
This discussion has been closed.