Extension talk:CustomNavBlocks

From MediaWiki.org
Jump to navigation Jump to search


Version: 1.18.1 Hi i added an image right below the logo to the sidebar and this works fine but there is so much space between the logo and the image below! and when there is text below the logo there is not so much space between it! this looks pretty buggy!

Error in Mediawiki 1.16.0[edit]

Upon installing this extension, I got the following error at the top of my wiki:

Notice: Undefined offset: 1 in .../extensions/CustomNavBlocks.php on line 46

Any ideas? --Gossamer 04:12, 4 February 2011 (UTC)

From what I can see looking at the code, this error is what happens when there is no pipe in your block name. The block name is supposed to take the form of "Pagename|title", but if it takes the form "Pagename" then the extension looks for $tpl->data['sidebar'][$block] (the "default sidebar item"?) and when it doesn't find that, it tries to set the variable blockTitle to the second item in a one item array, causing an error.

put TOC into sidebar[edit]

Could I use this extension to put a TOC for a page in the sidebar?--Two7s clash 14:34, 17 April 2010 (UTC)

edit tag[edit]

Can this extension switch off its edit tag? I seem to have one. Bsmither 17:11, 8 June 2009 (UTC)

I think I'm the only one seeing this as I'm the WikiSysop and as such, in the WikiMedia namespace, I can edit.Bsmither 02:50, 9 June 2009 (UTC)

User-defined sidebars[edit]

Is it possible for each user to change their sidebar in a custom way? — Preceding unsigned comment added by Trop (talkcontribs) [1]

  • Users may use JavaScript to customize their sidebars, as seen in Manual:Interface/Sidebar#Advanced customization. If most users are not technicians and thus are unable to write the necessary javascripts themselves, then wiki admins may create and provide predefined gadgets for their users. — 11:51, 11 March 2009 (UTC)

Blocks with capital letters[edit]

Is there a way for the blocks to start with capital letters? No mater what I do in the control page the block titles start with lower case letters. Do I need to edit the css? Thanks --Jeff.worldwide 19:48, 25 July 2008 (UTC)

Sorry for the late reply, but: This seems to be a problem with the english MediaWiki. This wiki (for which I originally wrote this extension) doesn't have this problem, but this wiki does. Also, the this wiki also has its block with lower-case strings. I will look into the matter and post it here. -- Mati 09:47, 17 August 2008 (UTC)
Ok, that was quick. Please see the upper-case block-titles-chapter on the subject-page. -- Mati 10:30, 17 August 2008 (UTC)

CustomNavBlocks version 2.0.0 requires MediaWiki version 1.13.0[edit]

If installed on MediaWiki 1.12.0 or older, CustomNavBlocks version 2.0.0 does display only the titles of navigation blocks, but not their content.

The $wgExtensionCredits contains version equal to '2.0.0-1.13.0'

The author should have raised the minimal required MediaWiki version 1.10.0 → 1.13.0 accordingly. — 19:09, 25 August 2008 (UTC)

  • Is there any way to get the version 2.0.0 working on MW 1.12? Thanks, Jiri. -- 21:29, 16 November 2008 (UTC)
    • There is no known way, and thus you should upgrade your MediaWiki to 1.13.5 or 1.14.0 instead. — 11:39, 11 March 2009 (UTC)

Using CustomNavBlocks version 2.0.0 over MediaWiki version 1.14.0[edit]

After upgrading MediaWiki to version 1.14.0, you may need to purge (manually!) each of your custom nav blocks and their list (your MediaWiki:CustomNavBlocks), especially if your MediaWiki skin has not been upgraded to MW1.14 yet. — 11:39, 11 March 2009 (UTC)

  • Note. You may also have to purge any custom block after editing it. It helps if the previous version of the edited block stucks in the sidebar. — 06:56, 23 August 2011 (UTC)

Conflicts with SidebarEx?[edit]

Hi. It works fine with me (Mediawiki 1.14), but it seems to conflict with SidebarEx. As soon as I activate SidebarEx, CustomNavBlocks stops working. Any suggestions? Thanks! MIkii

Search Bar & Titles[edit]

Im wanting the search bar to appear above the other sections created by the extension, im also wanting to remove the default section titles, how is this done?

Currently ive changed the css of h5 to 1% font size.. but prefer them to not be there (www.aionopedia.info) thanks

  • Try this CSS code:
.portlet h5 {
   display: none;
} 06:58, 23 August 2011 (UTC)

CustomNavBlocks and DynamicPageList (Wikimedia)[edit]

I'm using CustomNavBlocks along with DPL, and I've noticed that after some time the sidebar doesn't load custom blocks' content. The problem always disappeared when I purged cache of all custom blocks, so I decided to automatize this task, and done this little script: purgeSidebar.php. I put it in maintenance/ directory and let it run every day via cron. No more problems with disappearing blocks. Hope it will be useful for anybody. P.S. I'm not sure whether that is my cache config, or the DPL is screwing up, all I know is that purging blocks helps, so I made this script. Holek 23:08, 27 July 2010 (UTC)

External Link in new Tab / Window[edit]

I've tried using several solutions for having specific external links and sidebar external links open in a new tab, including these:

and this on my normal pages:

Neither worked for me, but I'm using CustomNavBlocks, so my problem might really be that Common.js contents don't apply on Mediawiki namespace pages. Have any of you CustomNavBlock users solved this problem? Thanks. --Skew 17:34, 7 February 2011 (UTC)

CustomNavBlocks Links[edit]

I am wanting to change the font size and colour of the links in the sections. I know the titles are done via the .portlet h5, tag.
I have tried the .portlet a {font-size: 130%;}, but with no effect. Is there a specific piece of css code that addresses this anywhere?
RoverOne 09:02, 30 November 2011 (UTC)

I have found my own solution to this. When creating the CustomNavBlocks menu names or links I used the div id="cusnav" and by doing so gave me the following:

#cusnav {
   font-size: 90%;

of course it then leaves it all open to then apply it to the ul, ul li, ul li a, and so on, css to your hearts desire.
RoverOne 07:28, 3 January 2012 (UTC)

Odd behavior when there is a trailing space in a block definition in Mediawiki:CustomNavBlocks[edit]

When you enter a block definition with a trailing space after the page name, this results in the block's content being populated with <Page Name > instead of the contents of Mediawiki:title. The block definiton:

Quicklinks |Quicklinks

generates a block like this one:

Quicklinks (block title, looking just as it should)
<Quicklinks > (block content, looking very wrong)

Removing the trailing space fixes the problem.

(Note: I had this problem at the same time that I was having the "Quicklinks" problem listed below, but I have been able to recreate this problem with other titles as well.)

Bizarre title problem[edit]

For some reason, when I set up a menu titled "Quicklink" or "Quicklinks", the first line of text displays where the title should be. If I change the title to something else, but change leave the page name quicklinks, the problem corrects itself.

Is this working with MW 1.19?[edit]

I'm migrating from 1.16 and it seems to be ignoring Mediawiki:CustomNavBlocks. I did a similar migration last month to 1.18 and it worked fine. I don't see any changes to the CustomNavBLocks.php file, is this working for failing for anyone else, and if it works did you have to do something to make it work?

Thanks. --Salquint (talk) 20:10, 31 May 2012 (UTC)

Inserting the search bar between other blocks[edit]

My users still use the Monobook skin, therefore the placement of the searchbar between other blocks is a important point. I suggest the following patch to version 2.2.1:

<         if (count($tmp) > 2 || count($tmp) < 1) {
>         if (count($tmp) > 2 || count($tmp) < 1 || $block == '') {
<         if (count($tmp) == 1 && isset($tpl->data['sidebar'][$block])) {
<             # try to find default sidebar item
<             $sidebar[$block] = $tpl->data['sidebar'][$block];
>         if (count($tmp) == 1) {
>             if( isset($tpl->data['sidebar'][$block]))
>                 # try to find default sidebar item
>                 $sidebar[$block] = $tpl->data['sidebar'][$block];
>             else if(strtoupper($block) == $block)
>                 # allow inclusion of predefined blocks like SEARCH
>                 $sidebar[$block] = true;

Hence any nonempty line in MediaWiki:CustomNavBlocks that does not contain a pipe and consists entirely of uppercase letters is passed to further processing as an empty block with that title. Thus, a line consisting of the word SEARCH (TOOLBOX, LANGUAGES, …) is interpreted as expected. - RV1971 (talk) 13:44, 1 February 2013 (UTC)

Problem with version 1.22.0?[edit]

Apparently it doesn't work, and provides the error message "Notice: undefined offset: 1 in <path>/wiki/extensions/CustomNavBlocks.php on line 48". Anyone else experiencing the same problem? It was OK on my wiki until version 1.21.3.

P.S.: the problem seems related to the use of SEARCH and TOOLBOX in my MediaWiki:CustomNavBlocks page, if I remove them from MediaWiki:CustomNavBlocks the problem disappears.
P.P.S.: Problem solved by applying the patch described above, under "Inserting the search bar between other blocks". Thanks, RV1971.

Blocks from other extensions disappeared[edit]

The block from Collection extension is not displayed when CustomNavBlock enabled. How to add it back?

Enabled only for certain skins?[edit]

How to enable the extension only for certain skins?


To include the extension, I suggest:
require_once "$IP/extensions/CustomNavBlocks/CustomNavBlocks.php";

In the current Vector skin (1.24), the first title (by design) does not appear. The applicable css included with the current version places a {display:none} rule on the first title. If you want to reverse, I suggest:
div#mw-panel div.portal.first h3 {display:block}

Finally, when editing your new Mediawiki: namespace pages, you must include the " * " symbol in front of your links to get the desired "list effect."

Doesn't work with mediawiki 1.28.[edit]

Don't use if you're with 1.28. I spent another 40 minutes for non working extension. Mediawiki needs to check and validate with developers if extensions work properly, can't just keep them available to public like this. I tested 3 other extensions, none of them works with recent version.

Possible solution (to be yet tested more extensively): on line 24 of CustomNavBlocks.php I commented out
$skin = $wgUser->getSkin();
It seems to work correctly now --Choralia (talk) 14:46, 8 May 2017 (UTC)

You Mean Horizontal?[edit]

Extension description says "this Wiki uses a vertical bar ('----') as a separator" Isn't that a horizontal bar?