Last modified: 2013-04-17 20:30:02 UTC
Gallery format shall support something like meta-property "page name" to link from image to page containing the property: {{#ask: [[Category:Some category]] | ?Has image | imageproperty=Has image | redirects=?page name | format=gallery }} Sadly, any kind of "fake" property (like [[Selfurl::{{PAGENAME}}|]] ) doesn't work. So the following patch is used on my project to archive the same goal: protected function addImageProperties( SMWQueryResult $results, ImageGallery &$ig, $imageProperty, $captionProperty, $redirectProperty, $outputMode ) ... if ( $redirectProperty == '?page name' ) { $redirects[] = $resultArray->getResultSubject()->getTitle(); }
The current implementation of gallery redirects does support page titles (oppose to the bug title which suggests it doesn't). The two options are supported (see examples [1]): * Using a dedicated property as redirect target ... |?Has redirect |redirects=Has redirect ... * Using the an image content page as target destination ... | redirects=- ... You can use [[Selfurl::{{PAGENAME}}|]] as reference object which should lead to a query containing ... |?Selfurl |redirects=Selfurl ... [1] http://www.semantic-mediawiki.org/wiki/Demo:Gallery/Redirects
James, Selfurl property doesn't work. You can check the example here: http://wikimipt.org/index.php/Bug_43161 Sergey
According to example at "http://www.semantic-mediawiki.org/wiki/Demo:Gallery/Redirects", magic constant "-" (instead of "?page name") shall be used. Closing the bug.