I am creating a small internal "guidelines" wiki for a GP practice.
It would be great to have the results of "whatlinkshere" as cross-references at the bottom of every page. I tried to include the page as a template, but this will still only give me the link to "whatlinkshere" instead of the actual linking pages. Any idea how I could get the links on the same page?
And while I am writing: Is there a way of telling mediawiki to open external links in a new window? I have tried everything to persuade the parser to accept the HTML code "target=_blank", but failed.
Thanks, Ulf
I am creating a small internal "guidelines" wiki for a GP practice.
It would be great to have the results of "whatlinkshere" as cross-references at the bottom of every page. I tried to include the page as a template, but this will still only give me the link to "whatlinkshere" instead of the actual linking pages. Any idea how I could get the links on the same page?
And while I am writing: Is there a way of telling mediawiki to open external links in a new window? I have tried everything to persuade the parser to accept the HTML code "target=_blank", but failed.
Thanks, Ulf
On Sun, Feb 13, 2005 at 03:21:45PM +0000, Ulf Clausen wrote:
I am creating a small internal "guidelines" wiki for a GP practice.
It would be great to have the results of "whatlinkshere" as cross-references at the bottom of every page. I tried to include the page as a template, but this will still only give me the link to "whatlinkshere" instead of the actual linking pages. Any idea how I could get the links on the same page?
Maybe you should have a look into SpecialPage.php and SpecialWhatlinkshere.php for inspiration. I think (!) it's basically creating a SpecialPage object and execute() it.
untested: include_once("includes/SpecialPage.php"); $sp = new SpecialPage("Whatlinkshere"); $sp->execute();
And while I am writing: Is there a way of telling mediawiki to open external links in a new window? I have tried everything to persuade the parser to accept the HTML code "target=_blank", but failed.
in the head: <base target="_blank" />
ciao, tom
It would be great to have the results of "whatlinkshere" as cross-references at the bottom of every page. I tried to include the page as a template, but this will still only give me the link to "whatlinkshere" instead of the actual linking pages. Any idea how I could get the links on the same page?
Maybe you should have a look into SpecialPage.php and SpecialWhatlinkshere.php for inspiration. I think (!) it's basically creating a SpecialPage object and execute() it. untested: include_once("includes/SpecialPage.php"); $sp = new SpecialPage("Whatlinkshere"); $sp->execute();
Excuse my lack of knowledge, but how and where do I include this code into my pages so it gets executed?
And while I am writing: Is there a way of telling mediawiki to open external links in a new window? I have tried everything to persuade the parser to accept the HTML code "target=_blank", but failed.
in the head:
<base target="_blank" />
Assuming I am editing the pages via the frontend - how do I actually include something in the head when the pages are actually generated dynamically?
Thanks, Ulf
Hi Ulf,
If you ever figure it out, please post what you had to do, no matter how complex. This is a feature I've always liked, but never wanted to get down and dirty to do.
Thanks,
Doug
On Feb 13, 2005, at 1:27 PM, Ulf Clausen wrote:
It would be great to have the results of "whatlinkshere" as cross-references at the bottom of every page. I tried to include the page as a template, but this will still only give me the link to "whatlinkshere" instead of the actual linking pages. Any idea how I could get the links on the same page?
Maybe you should have a look into SpecialPage.php and SpecialWhatlinkshere.php for inspiration. I think (!) it's basically creating a SpecialPage object and execute() it. untested: include_once("includes/SpecialPage.php"); $sp = new SpecialPage("Whatlinkshere"); $sp->execute();
Excuse my lack of knowledge, but how and where do I include this code into my pages so it gets executed?
And while I am writing: Is there a way of telling mediawiki to open external links in a new window? I have tried everything to persuade the parser to accept the HTML code "target=_blank", but failed.
in the head:
<base target="_blank" />
Assuming I am editing the pages via the frontend - how do I actually include something in the head when the pages are actually generated dynamically?
Thanks, Ulf
MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
With the caveat that I have not actually looked through the code, I suspect that this is a fairly expensive operation, causing at least a table index to be traversed. Pages are already too slow!
On 13 Feb 2005, at 11:36, Douglas Fields wrote:
Hi Ulf,
If you ever figure it out, please post what you had to do, no matter how complex. This is a feature I've always liked, but never wanted to get down and dirty to do.
Thanks,
Doug
On Feb 13, 2005, at 1:27 PM, Ulf Clausen wrote:
It would be great to have the results of "whatlinkshere" as cross-references at the bottom of every page. I tried to include the page as a template, but this will still only give me the link to "whatlinkshere" instead of the actual linking pages. Any idea how I could get the links on the same page?
Maybe you should have a look into SpecialPage.php and SpecialWhatlinkshere.php for inspiration. I think (!) it's basically creating a SpecialPage object and execute() it. untested: include_once("includes/SpecialPage.php"); $sp = new SpecialPage("Whatlinkshere"); $sp->execute();
Excuse my lack of knowledge, but how and where do I include this code into my pages so it gets executed?
And while I am writing: Is there a way of telling mediawiki to open external links in a new window? I have tried everything to persuade the parser to accept the HTML code "target=_blank", but failed.
in the head:
<base target="_blank" />
Assuming I am editing the pages via the frontend - how do I actually include something in the head when the pages are actually generated dynamically?
Thanks, Ulf
MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
:::: If you really want to hurt your parents, and you don’t have the guts to be a homosexual, the least you can do is go into the arts. -- Kurt Vonnegut :::: Jan Steinman http://www.Bytesmiths.com/Item/03GAB14
On Sun, 13 Feb 2005 18:27:39 +0000, Ulf Clausen u.clausen@gmx.net wrote:
Maybe you should have a look into SpecialPage.php and SpecialWhatlinkshere.php for inspiration. I think (!) it's basically creating a SpecialPage object and execute() it. untested: include_once("includes/SpecialPage.php"); $sp = new SpecialPage("Whatlinkshere"); $sp->execute();
A bit of testing suggests that this is essentially usable, except that the execute() method takes the page title as a parameter - so, in my test hacking of Parser.php, I found I could use $sp->execute("$this->mTitle->getText()"); Wherever you end up adding it, you'll probably be able to get at a "Title" object for the page being displayed, and call it's getText() method in this way.
However, I notice that this adds the text *as soon as it's called* rather than returning a block of HTML or whatever (which means you've got to find the right place to put it), and that it has a link like "< [[foo]]", which doesn't make sense if you're including it on-page. So you may want to look at SpecialWhatlinkshere and make a modified version that better suits.
Excuse my lack of knowledge, but how and where do I include this code into my pages so it gets executed?
That's a surprisingly awkward question. I guess somewhere in the skin hierarchy, really - which can be a fairly confusing maze...
On 1.3, I would suggest that if you can get a function to return a block of text with the backlinks in it, you could add somewhere in includes/SkinPHPTal.php (in OutputPage.php) something like: $tpl->set( "backlinks", function_that_generates_backlinks() ); and then in xhtml_slim.pt (e.g. just after "{$bodytext}"): {$backlinks}
1.4 is basically the same, but it doesn't use the PHPTal template by default, but a kind of "pre-compiled" version, so the first change is in includes/SkinTemplate.php, and the second, in skins/MonoBook.php, should be more like: <?php $this->html('backlinks') ?>
And while I am writing: Is there a way of telling mediawiki to open external links in a new window? I have tried everything to persuade the parser to accept the HTML code "target=_blank", but failed.
You might want to look at recent threads on this topic, such as: http://mail.wikimedia.org/pipermail/mediawiki-l/2005-February/thread.html#34... http://mail.wikimedia.org/pipermail/mediawiki-l/2005-January/thread.html#291...
I know most of what's been written amounts to "don't do it", but maybe those of you who really really feel like this is a good idea could get together and work something out...
mediawiki-l@lists.wikimedia.org