Forum:Script to hide "Read more" section on pages with navboxes

Something I whipped up and thought I'd share to help tame a stubborn feature. Adapted from Wikipedia's dynamic navigation bars code. Uses JavaScript to hide the "Read more" section if a page contains a table with "navbox" class.

Add to your MediaWiki:Common.js: function hideReadMore {   // iterate over all   or another name of your choosing? 01:17: Wed 16 May 2012
 * The code works perfectly. (I think.) Just sharing for anyone who wants to copy it. Rigel Kent 01:26, May 16, 2012 (UTC)


 * I'm sure it does work :) You'd obviously have no interest in posting code that didn't.  I don't doubt your coding skill in the slightest.  I just a) have never seen this problem (and would like to!) and b) don't understand why a JS solution would be better than just changing the CSS class to something which isn't affected by the problems associated with navbox.  01:42: Wed 16 May 2012
 * Oh, I see what you mean!
 * By stubborn feature, I meant "Read more" is stubborn, not navboxes. I love navboxes, doesn't everyone?
 * This script keeps navboxes, which editors put it when wanted, from getting crowded out by a redundant "Read more" on the same page, which editors may not want. While still allowing "Read more" to appear on pages without navboxes. Rigel Kent 03:34, May 16, 2012 (UTC)
 * Yeah, but where does this "read more" occur? I've never seen it before.  Can you direct me to a page somewhere that it's happening?   14:02: Wed 16 May 2012


 * The "Read more" section is added to the bottom of most pages on wikis where the extension is enabled. For example, look at the bottom of this page: http://bioshock.wikia.com/wiki/Cigarettes?useskin=wikia --Gardimuer { ʈalk } 16:17, May 16, 2012 (UTC)