Page MenuHomePhabricator

result format feed / increasing behaviour and usability (SMW 1.8 beta 2)
Closed, ResolvedPublic

Description

I believe it would be nice if one is able to set an icon to be shown instead of the value provided with parameter searchlabel


Version: unspecified
Severity: enhancement

Details

Reference
bz34172
TitleReferenceAuthorSource BranchDest Branch
utils.py: add method to check if scap is running in a screen tmuxrepos/releng/scap!271jijieffie-screenmaster
kubernetes: fix helm release in all known pending-* statesrepos/releng/scap!267dancymaster-I598f2f2aa19c0cf21c9a1bfcb9562266eb30c82bmaster
helm-check.py: Handle pending-rollback state toorepos/releng/gitlab-cloud-runner!375dancymain-Ied9913316a0793ce9370167d1799281b3e62bfe8main
Prevent scap from running outside of a screen or a tmuxrepos/releng/scap!266jijieffie-screenmaster
Customize query in GitLab

Related Objects

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 12:09 AM
bzimport set Reference to bz34172.
bzimport added a subscriber: Unknown Object (MLST).

Currently one can only have a link to the feed via the "searchlabel" parameter out of the box. I suggest to have an additional "icon" parameter which also links to the results like the "searchlabel". The custom icon should also be settable like it is done for the maps printers. Perhaps it is easier to have something like a "showicon" parameter too.

Thus one would have the following choices to display the results:

  1. RSS/Atom
  2. default/custom icon linking to RSS/Atom
  3. RSS/Atom + default icon linking to RSS/Atom
  4. RSS/Atom + custom icon linking to RSS/Atom
Unknown Object (User) added a comment.Nov 15 2012, 5:13 PM

Why should the display and behaviour be different from any other existing printer?

A lot of wikis I know also put a feed icon next to the result link manually to make it more visible that it is a feed that may be subscribed, including e.g. German wikipedia. Additionally the icon itself should be clickable to increase usability further. Currently it is not possible to do this out of the box.

Unknown Object (User) added a comment.Nov 15 2012, 5:45 PM

Instead of raising the level of parameters for individual solutions into infinity, I rather suggest that the search link is being assigned a CSS class that will look like ( change in SMWResultPrinter in getLink() ) and add

$link->setStyle( $this->params['format'] . ' ' . 'query link' );

This would individuals solutions per format (not only feed format), makes use of the ResourseLoader (as icons that are attached to this class are loaded via RL), and does not raise the maintainability level due to special codes/parameters.

My suggestion was a bit inspired by the map printers. However, I believe that you understood the actual "problem" raised. If it is possible to have another even better solution to the problem then I will of course go with that. :)

Unknown Object (User) added a comment.Nov 15 2012, 6:05 PM

Well [1] has what it needs to make this work. Once the CSS class is assigned, you can have a script replacing the text assign an icon or do all sorts of magic.

[1] https://gerrit.wikimedia.org/r/#/c/33592/

Unknown Object (User) added a comment.Nov 15 2012, 6:59 PM

After the above change has been merge, the only necessary is to add the lines below to the Mediawiki:Common.js in order to display a feed icon per further result link.

/**

  • Add link icon *
  • @rev 1
  • @author mwjames */

$( '.feed.further.results > a' ).addClass( 'feedlink' );

That's great. Thank you for making this possible! I will document this.

Unknown Object (User) added a comment.Nov 16 2012, 3:03 AM

'feedlink' is MW's own class that holds all necessary attributes (icon and position) for a standard feed icon which means that there is no need to declare any additional information in Common.css for class feedlink.

Of course if you need an individual attribution for the feed format or any other format, you can just do this my using the class name (concatenated "'format name'.further.results") as identifier.

It is getting better by the minute. :) Thank you for straightening things out for me. I just rectified the documentation.

I see nice usecases for result formats which provide export functionality, like CSV, BiBTeX, etc. Great

Unknown Object (User) added a comment.Nov 16 2012, 5:04 PM

I just had to change the class name to

"smw-" + format name + "-furtherresults" which means in case of the feed printer it will be 'smw-feed-furtherresults' resulting in

$( '.smw-feed-furtherresults > a' ).addClass( 'feedlink' ); to Common.js and for others it will be 'smw-cvs-furtherresults', 'smw-bibtex-furtherresults' etc.

Unknown Object (User) added a comment.Nov 16 2012, 8:17 PM

Merged with 1.9 branch