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.
Linking directly to a comment
Hi,
I'm sure this has been covered, or that I am being a drongo, but I could find nothing in the doc/forums.
I am uncertain how to link to directly to a comment in a discussion. I know Vanilla supports direct linking to the most recent comment, and you can use #item_x to link to a comment...but I am not sure how to access the actual #item_x URL. Any ideas?
0
This discussion has been closed.
Comments
For the record, I took a look at it and saw that you had to resort to using a global variable. So, I added the $RowNumber to the delegate parameters collection in subversion. When the next revision comes out you'll be able to remove that global and just rely on the parameter.
Or else, Vanilla framework is just waaaaayyy easy to understand.
For the record, here is what I changed the source of the extension to here on lussumo.com/community:
<?php /* Extension Name: Comments Permalinks Extension Url: http://lussumo.com/docs/ Description: Adds a "permalink" link to every comment, so you can share a single comment's url. Version: 1.0 Author: Remi Cieplicki Author Url: http://remouk.alt-tab.org/ You should cut & paste this language definition into your conf/your_language.php file (replace "your_language" with your chosen language, of course): */ $Context->Dictionary['Permalink'] = 'permalink'; function CommentGrid_Permalinks(&$CommentGrid) { $RowNumber = $CommentGrid->DelegateParameters['RowNumber']; $CommentList = &$CommentGrid->DelegateParameters["CommentList"]; $CommentList .= '<a href="#Item_'. $RowNumber .'" id="Permalink_'. $RowNumber .'">' . $CommentGrid->Context->GetDefinition("Permalink").'</a>'; } $Context->AddToDelegate("CommentGrid", "PostCommentOptionsRender", "CommentGrid_Permalinks"); ?>
P.S. Whispers must not have their own permalinks, I'll handle that (hopefully tomorrow).
Additionnal question: why is Vanilla using Item_id instead of the real Comment_id (which cannot change, even if there are whispers or hidden comments)?
Hey remouk,
why not allow permalinks on whispers?
(btw the new look of the preview post is awesome)
example