[Fwd: Re: [Mediawiki-l] using images as icons]
For enhancing the aspect of the opensuse pages, the use of images is very nice. However, mediawiki images use to link only to they own page, so clicking on the image don't send to the link waited by most users (the normal icons way); I asked about this on the mediawiki list and was answed this (below). could somebody test this and if good insert the appropiate code? I've no php knowledge and can't do it myself thanks jdd -------- Original Message -------- Subject: Re: [Mediawiki-l] using images as icons Date: Tue, 30 Aug 2005 12:04:04 -0700 From: Joshua Oreman <oremanj@gmail.com> Reply-To: MediaWiki announcements and site admin list <mediawiki-l@Wikimedia.org> To: MediaWiki announcements and site admin list <mediawiki-l@wikimedia.org> References: <431491BD.3020408@dodin.org> <1e55af9905083010535183bf0f@mail.gmail.com> <1e55af9905083011012c850e9@mail.gmail.com> <1e55af9905083011036829d6e0@mail.gmail.com> On 8/30/05, Sy <sy1234@gmail.com> wrote:
On 8/30/05, jdd <jdd@dodin.org> wrote:
is there a way to use images as icons, that is clicking on the image drives to an other page, not the image page.
Did some more thinking.. the only solution I can see is some kind of extension designed to do this.
Yep. Untested, but should work. extensions/ImageLink.php: --snip-- require_once('../includes/Image.php'); $wgExtensionFunctions[] = "wfImageLink"; function wfImageLink() { global $wgParser; $wgParser->setHook ('imglink', 'renderImageLink'); } function renderImageLink ($text, $attr) { global $wgParser, $wgUser, $wgTitle; $parserOptions = ParserOptions::newFromUser( $wgUser ); $parser =& new Parser(); $output =& $parser->parse("[[".$input."|IMAGE]]", $wgTitle, $parserOptions); $ret = $output->getText(); $itag = "<img border='0' "; foreach ($attr as $k => $v) { if ($k == "src") { $itag .= "src='" . Image::imageUrl($attr['src']) . "' "; } else { $itag .= "$k='$v' "; } $itag .= "/>"; return str_replace ($ret, "IMAGE", $itag); } --snip-- and add require_once('extensions/ImageLink.php'); to LocalSettings.php. To use, do <imglink src='MyImage'>Destination page</imglink> instead of the doesn't-work [[Destination page|[[Image:MyImage]]]] You can also use height and width attributes on the <imglink> tag. Hope this helps. -- Josh
_______________________________________________ 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 -- pour m'écrire, aller sur: http://www.dodin.net http://valerie.dodin.net http://arvamip.free.fr
On 31/08/05, jdd <jdd@dodin.org> wrote:
For enhancing the aspect of the opensuse pages, the use of images is very nice. However, mediawiki images use to link only to they own page, so clicking on the image don't send to the link waited by most users (the normal icons way);
Another way is to use a redirect on the image description page. This is the way the bug image and download image on the frontpage of OpenSUSE.org work. Try: http://www.opensuse.org/index.php?title=Image:Bug.png The drawback is that each image then becomes linked with a particular page, and this causes issues when it is used elsewhere in the wiki. One could just upload the same image for each navigational icon one needs but if we could find a way to use single storage and some script that would be good. Pflodo
Peter Flodin wrote:
Another way is to use a redirect on the image description page.
it don't really works as expected, and the behavior changes with the mediawiki version, it's worst with the 1.5 new version. Example: http://dodin.org/mediawiki/index.php/Image:Image-test-Ftp.jpg * the image is added on top of the page (this could be seen as an enhancement to the page :-) * the image page content (at least the automatic part of) is added at the end of the page. This is not very important, though, but for very small pages where it's disturbing.
This is the way the bug image and download image on the frontpage of OpenSUSE.org work. Try: http://www.opensuse.org/index.php?title=Image:Bug.png
mediawiki 1.4.6. I made the tests on mediawiki 1.5 and a one line test page :-(
The drawback is that each image then becomes linked with a particular page, and this causes issues when it is used elsewhere in the wiki.
true
One could just upload the same image for each navigational icon one needs but if we could find a way to use single storage and some script that would be good.
there is a bug report in mediawiki http://bugzilla.wikimedia.org/show_bug.cgi?id=539 that I don't fully understand, given my weekness on php :-(. jdd -- pour m'écrire, aller sur: http://www.dodin.net http://valerie.dodin.net http://arvamip.free.fr
participants (2)
-
jdd
-
Peter Flodin