Forum:Personal Sitenotice

Is there a way to add a user-only sitenotice? Or at least mimic what it does? It would be easier for me to have a link at the top of the page at times rather than placing it somewhere in my userpage. I Lion Heart I 15:50, 7 December 2008 (UTC)


 * If what you need are only links to articles, you could edit your Special:MyPage/Monaco-sidebar to add menu items to the sidebar menu. See w:c:help:Help:Customizing Monaco. If no, then you have to do it using javascript. --Ciencia Al Poder (talk) -WikiDex 16:38, 7 December 2008 (UTC)
 * Does not liek Monaco and prefers Monobook. Also this code will stretch further than just that. I want the code to be at the top of every page so when doing certain projects I can quickly get back to the central page. Sometimes I do other things, like moves, and then need to remember to fix links after changing them on templates they are used on and waiting for the WikiCache to refresh. Site-notices grab my attention. I don't know javascript, and don't plan on learning anytime soon, so if someone knows how I can implement it, 'twould be smashing. I Lion Heart I 17:47, 7 December 2008 (UTC)


 * Put this in your personal javascript:

var personalSiteNoticeValue = 'PUT HERE THE CONTENTS OF THE SITENOTICE';

function setPersonalSiteNotice{ var fh = $('bodyContent'); if (!fh || !window.personalSiteNoticeValue || window.personalSiteNoticeValue == '') return; do { fh = fh.previousSibling; } while (fh && (fh.nodeType != 1 || fh.nodeName.toLowerCase != 'h1' || (' '+fh.className+' ').indexOf(' firstHeading ') == -1)) if (!fh) return; var sn = $T.create('div', {'id':'personalSiteNotice'}); fh.parentNode.insertBefore(sn,fh); sn.innerHTML = window.personalSiteNoticeValue; }

$E.onDOMReady(setPersonalSiteNotice);


 * You must edit the first line ( var personalSiteNoticeValue = 'PUT HERE THE CONTENTS OF THE SITENOTICE'; ). Replace the string PUT HERE THE CONTENTS OF THE SITENOTICE inside the single quotes with the HTML code you want to put there.
 * When you put text inside it, note that:
 * you shouldn't delete the single quotes.
 * Also note that you have to put there pure HTML code, and not wiki syntax. If you have problems getting the HTML code to put, create the wiki code on a page, view the HTML source and paste the relevant source code you want here.
 * The code must be in one single line. Remove any newlines from it.
 * Put a  character before any single quote that could appear in your text.
 * Also, because it has a different id to respect any legitimate sitenotice, you could put the following on your personal CSS file to make it look like the sitenotice. If not, it will be shown left aligned:

text-align: center; font-size: 95%; padding: 0 .9em; border:none; }	margin: 0; padding: 0; }
 * 1) siteNotice {
 * 1) siteNotice p {
 * --Ciencia Al Poder (talk) -WikiDex 20:45, 7 December 2008 (UTC)
 * I forgot to thankyou for the code. Thanks. ;) I Lion Heart I</FONT> 20:08, 11 December 2008 (UTC)
 * You are welcome! --Ciencia Al Poder (talk) -WikiDex 21:23, 11 December 2008 (UTC)