Last modified: 2013-04-17 20:30:02 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T45161, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 43161 - Selfurl property doesn't work for gallery format
Selfurl property doesn't work for gallery format
Status: RESOLVED WORKSFORME
Product: MediaWiki extensions
Classification: Unclassified
SemanticResultFormats (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-12-15 22:52 UTC by Sergey Vladimirov
Modified: 2013-04-17 20:30 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Sergey Vladimirov 2012-12-15 22:52:16 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();
}
Comment 1 MWJames 2012-12-16 03:42:48 UTC
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
Comment 2 Sergey Vladimirov 2012-12-16 10:40:45 UTC
James,

Selfurl property doesn't work. You can check the example here:

http://wikimipt.org/index.php/Bug_43161

Sergey
Comment 3 Sergey Vladimirov 2013-04-17 20:30:02 UTC
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.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links