Semanticmediawiki: Templatefile format is not receiving intro and outro parameters

Created on 25 Jan 2020  路  10Comments  路  Source: SemanticMediaWiki/SemanticMediaWiki

Setup and configuration

  • SMW version: 3.2.0-alpha
  • MW version: 1.33.2
  • PHP version: 7.3.12
  • MySQL version: 5.6.46-86.2

Issue

The templatefile format is not sending intro and outro parameter values to the output file.

Steps to reproduce

See here: https://sandbox.semantic-mediawiki.org/wiki/Issue/4467

question

All 10 comments

The templatefile format is not sending intro and outro parameter values to the output file.

I'm not sure (without having looked at it) but I don't think export formats in general will produce an intro/outro text.

I'm not sure (without having looked at it) but I don't think export formats in general

... and the reason is that it checks for $results->getCount() > 0 [0] which in case of export formats is always "0" since we only produce a link when embedded.

[0] https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/src/Query/ResultPrinters/ResultPrinter.php#L382-L398

The docs says we can use them [0] and they also appear at Special:Ask (when selecting the templatefile format) [1]

[0] https://www.semantic-mediawiki.org/wiki/Help:Templatefile_format
[1] https://www.semantic-mediawiki.org/wiki/Special:Ask

The docs says we can use them [0] and they also appear at Special:Ask

I said "... when embedded ...".

I think I need to clarify before any misunderstanding: I think intro and outro should be placed inside the contents of the file, not _before_ and _after_ the link to the file.

But thinking right now, they would be exactly like introtemplate and outrotemplate if they do... Now I am confused of how they should behave. :thinking:

I think I need to clarify before any misunderstanding: I think intro and outro should be placed inside the contents of the file, not before and after the link to the file.

The intro/outro parameters are to encapsulate the result as in <intro> <actual results> <outro> while introtemplate/outrotemplate should be used to add something to the top (or bottom) before (or after) the actual template has generated the result output.

Thanks for clarifying @mwjames. I have had understood like intro/outro for just (simple) texts to be added and introtemplate/outrotemplate as "complex" (templates) texts.

I guess this is clarified now and can be closed?

@kghbln I think the documentation should mention that intro/outro parameters will not produce anything when specified. So I added this note:
https://www.semantic-mediawiki.org/w/index.php?title=Help%3ATemplatefile_format&type=revision&diff=73874&oldid=66414

Thanks a lot. I think that the #smwdoc parser function could use some improvement. There are quite some other exceptions this one does not take into account. On the other hand it might be to much effort to make it accommodate for it. Definitively not a front burner improvement.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

djoris picture djoris  路  4Comments

alex-mashin picture alex-mashin  路  4Comments

JeroenDeDauw picture JeroenDeDauw  路  3Comments

OyvindLGjesdal picture OyvindLGjesdal  路  3Comments

WolfgangFahl picture WolfgangFahl  路  3Comments