Page MenuHomePhabricator

Add "intro" parameter to "for template"
Closed, ResolvedPublic

Description

It would be great to have content such as a descriptive paragraph appear
within the labelled frame of a multi-instance form template (i.e the <fieldset> created by |label= on the definition of the sub-form template), but not have that
text repeated with every added instance of the form.

Currently, if the text is added within the embedded template
definition it is repeated with every instance. And if added in the
parent form then it is out of the boundary of the frameset of the sub-form instances.

Event Timeline

This is probably best done with a new parameter, "intro=", for the {{{for template}}} tag (it should take effect whether or not there's a "label=" value).

Yaron_Koren renamed this task from text within frameset to Add "intro" parameter to "for template".Feb 22 2021, 4:45 PM

Hi Yaron, I want to get started with a Micro-Task.

Hi @Yaron_Koren , I have some doubts about this microtask.

  1. I read the documentation, https://www.mediawiki.org/wiki/Extension:Page_Forms/Defining_forms#'for_template'_tag, will the new parameter be added in this tag? For example: will it be used like this? Ex: {{{for template|Template1|label=labelTemplateOne|multiple|intro="This is introduction of this Multi Instance Template"}}}
  1. If there is a "|label=" value or not, will the intro be displayed irrespective of its value?

Let me know what are your thoughts.
Thanks.

Good questions. (1) Yes, that's right - though without the quotation marks. (2) Yes.

@Yaron_Koren, thanks for the reply. I have got a design in my mind, I shall implement it and submit a patch.

Change 671139 had a related patch set uploaded (by Yashvarshney02; owner: Yashvarshney02):
[mediawiki/extensions/PageForms@master] Add "intro" parameter to "for template"

https://gerrit.wikimedia.org/r/671139

Hi @Yaron_Koren , I have submitted a patch. The form definition looks like this

{{{for template|T1|label=Test Form|multiple||intro=Hi this is introduction of the multiple-instance template}}}

image.png (348×701 px, 13 KB)

This looks good! Though just to be clear, I said that the intro value should be displayed regardless of whether there's a label or not.

Thanks for the feedback. I have made some changes so that the "intro" parameter works when "|multiple" is used irrespective of the usage of the "|label" parameter. The updated patch is uploaded here: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/PageForms/+/671139/2

This looks even better. Though I should have clarified that "intro" should also take effect on a non-"multiple" template - there's no reason to ever ignore it, if it's set, I would say.

You are right. I have made the "intro" parameter work for the non-multiple instance template also. Here is the patch - https://gerrit.wikimedia.org/r/c/mediawiki/extensions/PageForms/+/671139/3

Change 671139 merged by jenkins-bot:
[mediawiki/extensions/PageForms@master] Add "intro" parameter to "for template"

https://gerrit.wikimedia.org/r/671139

Yaron_Koren claimed this task.