User blog:Phlox/Citations for SMW information

The goal of a well engineered infobox is to avoid double flushing if at all possible. This means accessing parameters rather than swm queries. Refs will work with smw queries but not parameters due to the evaluation sequence of the wikimedia engine. Parts of the syntax are evaluated before others such as with the &lt;ref&gt; tag (as well as any other wikitext tags enclosed in &lt;&gt; symbols). So what does this have to do with footnotes? Say a user goes to the form and corrected a source for the birth facts. When the form is saved, wikitext for the ref is expanded first prior to expanding the parameters. It means that parameters in a function can be never used inside of ref tags.

So we have to do something different. I looked at the old code for how Wikipedia did footnotes prior to the ref tag. I don't think we want to go there.

The approach I am going after now is to directly manage the footnotes. We differentiate these smw footnotes from normal inline refs by using non numeric symbols. eg double dagger &Dagger; for birth smw notes, sect&sect; for wedding/spouses notes and so on. So when the infobox code executes, we display the footnote mark if either of the "sources" or "notes" parameters have a value. Then when the Notes template is displayed, we do the same thing and display the contents of the parameters. This is possible because SMW forms has a tricky thing where you can get it to save the same form parameter value on more than one template. Without this hack we would be stuck with double flushing.

So if this works, then this note can be referred to as a technical explanation why we aren't using ref tags. Maybe at some time there will be better extensions for footnotes, and this approach can be revised to something more straightforward and uniform.