Topic on Extension talk:Semantic Organization/Flow

DuetSS (talkcontribs)

A verification of how it works.

SMW Embed template has 3 steps

  1. Add a tag like "{{{field|Skills|holds template}}}" within the "Person" template part of the form definition
  2. Add "{{{Skills|}}}" somewhere inside the page Template:Person, so that it gets displayed in pages
  3. Add "|embed in field=Person[Skills]" to the "{{{for template|Skill|multiple" part of the form definition

In SMW SO using, embedded Files as an example, the generator embed appears to work like this:


A) In en.json, using meeting as an example, you add

      "semorg-field-meeting-files-name": "Files",

    "semorg-field-meeting-files-parameters": "holds template",

ie {{{field|meeting-files|holds template}}} This solves 1. above.


B) The next thing I find on the generated page is

als embedded

{{semorg-form-template-embed|meeting|}}

And is inserted in Form:<feature>.


C) This manages steps 2 and 3 above. It does so by calling Template:Semorg-form-template-embed which expects and has the following paramaters.

|{{int:semorg-{{{1|}}}-template}}

|multiple

|embed in field={{{2|}}}

|add button text={{int:semorg-form-{{{1|}}}-add-button-text}}

|displayed fields when minimized={{int:semorg-form-{{{1|}}}-displayed-fields-when-minimized}}

From the B) and C) above it becomes apparent that embed als {{semorg-form-template-embed|meeting|}}leaves out the {{{2|}}} paramater which you must add. In this case "Files".

But that makes the <feature> multiple and not files. So you must also change "meeting" to "file".

So we now have

i) paramater |file| supplying Template:Semorg-file.

ii) paramater |files supplying "embed in field".

and this correctly opens the File template dialogue. (If you leave {{{2|}}}out the button does not appear.)

And saves to the page.

Thai (talkcontribs)

Thanks for helping to make this more clear. I added some explanatory text on the generated page. At B) you would have to look at the generated page for file since that's the feature you want to embed. The second parameter of the semorg-form-template-embed call should be the target field as you correctly pointed out. To be on the safe side it should be referenced in the form <feature>[<field>], e.g. meeting-group[files].

Reply to "Embed Template"