Note: This only works for Paid/Perm account holders who have access to Advanced Customization.
How do I completely remove a link from the entry and/or comment linkbar?
A few people have asked how to completely remove the "track this" and "add to memories" links in the linkbar, so here's how to do it.
Step 1:
Locate the sections of code that deal with the linkbars in your theme layer*. The codes are a little different for each template so I've included instructions for the popular templates below.
• If you are using kunzite1's version of halffling's code: (1) Under Entry::print_linkbar find this:
# gather current linkbar foreach var string link_key ($.link_keyseq) { var Link link = $this->get_link($link_key); $link_url{$link_key} = $link.url; $link_caption{$link_key} = $link.caption; $link_image{$link_key} = $link.icon.url; $link_keyseq[$keyseq_index++] = $link_key; # add this to new link_keyseq array }(2) Under EntryPage::print_comment find this:
# some links for doing stuff to this comment foreach var string k ($c.link_keyseq) { var Link link = $c->get_link($k); if ($link) { """ $link.caption """; } } """ $*text_permalink $parent$thread
• If you are using halffling's code: (1) Under Page::print_entry find this: var string{} caption = { "edit_entry" => "Edit Entry", "edit_tags" => "Edit Tags", "mem_add" => "Add to Memories" }; foreach var string key (["edit_entry","edit_tags","mem_add"]) { var Link link = $e->get_link($key); if ($link) { """ $caption{"$key"} """; } } """ (2) Under EntryPage::print_comment find this:
# some links for doing stuff to this comment foreach var string k ($c.link_keyseq) { var Link link = $c->get_link($k); if ($link) { """ $link.caption """; } } """ $*text_permalink $parent$thread
• If you are using ignited's code: (1) Under Page::print_entry find this: foreach var string key
(["edit_entry","mem_add","tell_friend"]) { var Link link = $e->get_link($key); if ($link) { """ $link.caption """; } } """ $*text_permalink (2) Copy the following (from the Opal Raw Source code) and paste it into your theme layer.
function EntryPage::print_comment(Comment c) {
var string datetime; $datetime = $c->time_display();
# some links for doing stuff to this comment foreach var string k ($c.link_keyseq) { var Link link = $c->get_link($k); if (defined $link) { """ $link.caption """; } }
• If you are using pamelajoy's code: (1) Under Page::print_entry find this: foreach var string key
(["edit_entry","mem_add","tell_friend"]) { var Link link = $e->get_link($key); if ($link) { """ $link.caption """; } } """ Link (2) Under EntryPage::print_comment find this: foreach var string k ($c.link_keyseq) { var Link link = $c->get_link($k); if ($link) { """ $link.caption """; }
}
• If you are using grrliz's code: (1) Under Page::print_entry find this:
foreach var string key (["edit_entry","mem_add","tell_friend"]) { var Link link = $e->get_link($key); if ($link) { """ $link.caption """; } } """ $*text_permalink (2) Follow the steps given for ignited's code above.
• If you are using carriep63's code: (1) Under Page::print_entry find this:
"""; $e.comments->print();
foreach var string key (["edit_entry","edit_tags","mem_add","tell_friend"]) { var Link link = $e->get_link($key); if ($link) { """ $link.caption """; } } """ $*text_permalink
(2) Under EntryPage::print_comment find this: foreach var string k ($c.link_keyseq) { var Link link = $c->get_link($k); if ($link) { """ $link.caption """; } }
Note: If you do not include one of these in your list, it will not print (i.e., if you leave "mem_add" out, there will not be a "Add to Memories" link in the linkbar).
Note: This does not change where it says "comment", "# comments", "permalink", "parent", or "thread" it is for the other links in both linkbars.
Step 3:
Save and Compile your theme layer.
* If you don't have a theme layer, you need to create one. Follow these instructions in s2howto. Make sure to select "Opal (Libra OSWD)" under "Layout". Then copy function Page::print_entry (Entry e) from the Opal Source, paste it into your new theme layer, make the changes listed above, and compile. Then follow this to apply the changes to your journal.