I have a simple tage extension that I wrote. It currently gets the name of the article through $_GET['article']
However this is an issue where pages that are not the main name space do not work because $_GET['article'] ends up equaling something like nameSpace:articleName
Is there a way to grab the article name and name space separately? It would be even better if I could access the page id.
The php in the extension where I need to use this is
function efBildrTagsRender( $input, $args, $parser ) { return '<img src="http://test.com/'.$_GET['title'].'.jpg" />'; }
Thanks,
-Adam
On Mon, May 31, 2010 at 5:38 AM, Adam Meyer meyer7@mindspring.com wrote:
I have a simple tage extension that I wrote. It currently gets the name of the article through $_GET['article']
However this is an issue where pages that are not the main name space do not work because $_GET['article'] ends up equaling something like nameSpace:articleName
Is there a way to grab the article name and name space separately? It would be even better if I could access the page id.
Look in Title.php and use these, for example:
$wgTitle->getDBkey(); $wgTitle->getNamespace();
Good luck.
Works perfectly, thank you!
On May 31, 2010, at 4:08 AM, Łukasz Garczewski wrote:
On Mon, May 31, 2010 at 5:38 AM, Adam Meyer meyer7@mindspring.com wrote:
I have a simple tage extension that I wrote. It currently gets the name of the article through $_GET['article']
However this is an issue where pages that are not the main name space do not work because $_GET['article'] ends up equaling something like nameSpace:articleName
Is there a way to grab the article name and name space separately? It would be even better if I could access the page id.
Look in Title.php and use these, for example:
$wgTitle->getDBkey(); $wgTitle->getNamespace();
Good luck.
-- Lucas 'TOR' Garczewski Wikia Tech Team
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
mediawiki-l@lists.wikimedia.org