Page MenuHomePhabricator

Re-format/style facts section
Closed, ResolvedPublic

Description

Author: eep

Description:
I would like to reformat/restyle the "Facts about {{PAGENAME}}" section. Specifically, I want to group relationships/attributes and change how the layout is--perhaps even using that section as the entire page since it will end up duplicating everything on the page anyway as how I envision linking together everything. I could also just hide the "div.smwfact" CSS element but then I'd need a way to create all those semantic links...


Version: unspecified
Severity: enhancement

Details

Reference
bz10935

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:53 PM
bzimport set Reference to bz10935.

Re-assign to extension developer for triage/comments.

SMW 1.4, to be released soon, now includes a hook "smwShowFactbox" that can be used for modifying Factbox display with extension code. Functions registered to this hook will receive the result text (which they may modify/extend), and the printed data (contained in a suitable object). If the hook function returns FALSE, then the Factbox of SMW will not be displayed, thus allowing extensions to completely replace the Factbox. Otherwise, extensions can also add output text before the Factbox and return TRUE to have the Factbox printed as usual.

See SMW_Factbox.php for the current Factbox display code (probably a good basis for doing modifications). This file also contains the hook call (the code is currently the only detailed documentation for this hook).

Beyond this, no further support for Factbox customisation will be provided by SMW. There are just too many possible styling options to attempt to cover them with configuration settings in SMW. Factbox printing extensions should require only little code, but could still be publicly released as add-ons to SMW.