Forums: Index → Community Central Forum → Talk Page Links on Answers Sites
Fandom's forums are a place for the community to help other members.
To contact staff directly or to report bugs, please use Special:Contact.
To contact staff directly or to report bugs, please use Special:Contact.
Does any one know the code to add talk page links on Answers sites? I have recently created Fable Answers and need a bit of a hand with other things too. If you are any good with Answers customization, please contact me. Thanks, ☆The Solar Dragon (Talk)☆ 08:23, May 20, 2010 (UTC)
Well I just wrote this code which is based on this .
/*This code is Open Source, the way things should be. feel free to use it whatever why you see fit. If possible please give credit. If not, no big deal. -ShadowTale */ function onloadhookcustom() { EditButton(); } if (window.addEventListener){window.addEventListener("load",onloadhookcustom,false);} else if (window.attachEvent) {window.attachEvent("onload",onloadhookcustom);} function EditButton(){ var currentpage = location.href; if(currentpage.search("Special")==-1) //this test to see if the URL contains the word "Special" { $('#request_wiki').after('<a> </a><a class="wikia-button" accesskey="e" title="Discussion about this Answer. [T]" href="' + wgServer + '/index.php?title=Talk:'+ encodeURIComponent (wgPageName) +'" id="ca-edit" rel="nofollow">Discussion </a>');
I haven't tested it yet so have a try by adding the code to the wiki's MediaWiki:Common.js. Manyman Talk 05:38, May 22, 2010 (UTC)
- Didn't seem to work. Tried it but nothing happened. ☆The Solar Dragon (Talk)☆ 06:33, May 22, 2010 (UTC)
- No. Still nothing. ☆The Solar Dragon (Talk)☆ 09:57, May 22, 2010 (UTC)
Here, use this:
/* Modified from ShadowTale's AnswersEditButton by Grunny, adds a link to the Talk page on Answers Wikis */
function onloadhookcustom() {
TalkPageButton();
}
if ( window.addEventListener ) {
window.addEventListener("load",onloadhookcustom,false);
} else if ( window.attachEvent ) {
window.attachEvent("onload",onloadhookcustom);
}
function TalkPageButton() {
var currentpage = location.href;
if( currentpage.search("Special") == -1 ) {
$('#request_wiki').after('<a> </a><a class="wikia-button" accesskey="t" title="Discussion about this Answer. [t]" href="' + wgServer + '/index.php?title=Talk:'+ encodeURIComponent (wgPageName) +'" id="ca-talk" rel="nofollow">Talk page</a>');
}
}
Cheers, Grunny (talk) 10:33, May 22, 2010 (UTC)
Ah, that worked. Thanks. ☆The Solar Dragon (Talk)☆ 11:33, May 22, 2010 (UTC) Only problem is it doesn't do User pages but otherwise, it is fine. ☆The Solar Dragon (Talk)☆ 11:34, May 22, 2010 (UTC)