Jump to content

Extension talk:BrettCrumbs

Add topic
From mediawiki.org
Latest comment: 10 years ago by Brett.Dutton in topic Display all sub pages under a main page

Escape HTML

[edit]

$arr[$i] should probably be replaced by htmlspecialchars($arr[$i]) Bryan 19:26, 25 July 2008 (UTC)Reply

Thanks Bryan, I made the suggested change. --Brett.Dutton 23:26, 28 September 2008 (UTC)Reply

BrettCrumbs in every section

[edit]

I would love to use this extension in a Wiki with an extensive subpage hierarchy - but my system keeps adding the URL to every section of the longer pages. Any ideas how to fix it?

Kind Regards Gavin --81.158.214.204 00:22, 11 March 2009 (UTC)Reply

Updated This

[edit]

Gavin, I have updated BrettCrumbs to use a different Hook (OutputPageBeforeHTML) This seems to give better results and not put urls in every section. I also noticed that the Calendar extension might be using the parser incorrectly, that is why the bread crumbs URLs are appearing in every section (that the calendar is used in).

I updated the code in BrettCrumbs.php to be able to toggle off the creation of the links and updated the calendar.php to look something like this:

    toggleBrettCrumbs ( false );
	$o = & $parser->parse(
		$calstr,
		$wgTitle,
		ParserOptions::newFromUser($wgUser),
		true,
		false);
    toggleBrettCrumbs ( true );

Let me know if you want all the code. --Brett.Dutton 06:27, 11 May 2009 (UTC)Reply

Great stuff, thanks

[edit]

I am using it where appropriate, e.g. in http://www.staerk.de/thorsten/index.php/My_Tutorials/Programming_Tutorials/C_Programming_Tutorial/How_to_simulate_a_keypress. I added one line:

if ( strpos ( $wgTitle->getPrefixedText(), "/" ) === false ) return true;

meaning if the article is a top-level-article, do not show the brettcrumbs. --ThorstenStaerk 15:37, 10 May 2009 (UTC)Reply

Good addition. Thanks Thorsten. I have added your changes. --Brett.Dutton 10:40, 17 June 2009 (UTC)Reply

Problem with " " in article title

[edit]

I'm not quite sure about it, but mediawiki (1.15) seems to try to do redirect, if in title is " " character, and change it in "_". And it's unable to do that, because (as logs said) PHP Warning: Cannot modify header information - headers already sent by (output started at ../wiki/almanach/extensions/BrettCrumbs.php:42) in ../wiki/includes/WebResponse.php --Sauron 13:16, 16 September 2009 (UTC)Reply

Hi Sauron, this is the first I have heard about it. Can you ensure that you do not any blank lines at the end of the file BrettCrumbs.php. There is no line 42 and I can only imagine that it has started to do html after the ?>. I have adjusted the code to remove the ?> at the end of the file. If the proiblem continues, please zip up the extension and email to me and I will try to replicate. --Brett.Dutton 22:48, 20 October 2009 (UTC)Reply

Changes to Mediawiki URL for 1.14

[edit]

Updated BrettCrumbs.php --Brett.Dutton 21:26, 16 June 2010 (UTC) I noticed that in the latest media wiki they have moved away from the url http://www.mediawiki.org/w/index.php/Foo/Bar in favour of the http://www.mediawiki.org/w/index.php?title=Foo/Bar. I have updated BrettCrumbs to handle the changeReply

[edit]

Found a bug when the title contains a & so added a urlencode ( $arr[$i] ); so that the link is correct. --Brett.Dutton 06:40, 13 July 2011 (UTC)Reply

Display all sub pages under a main page

[edit]

Hi, Thanks a lot for building this. I really use it very much. However, is there a way to show on a page, what sub pages are present (like under toc)?

Thanks

You could do this by scanning the text. Would add complexity to the Extension, so will probably not implement --Brett.Dutton (talk) 00:56, 11 June 2014 (UTC)Reply