Last modified: 2013-04-12 20:12:13 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T49154, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 47154 - Allow embedded template to appear before it's using templates
Allow embedded template to appear before it's using templates
Status: RESOLVED INVALID
Product: MediaWiki extensions
Classification: Unclassified
SemanticForms (Other open bugs)
REL1_20-branch
All All
: Unprioritized enhancement (vote)
: ---
Assigned To: Yaron Koren
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-04-12 03:10 UTC by Al Johnson
Modified: 2013-04-12 20:12 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Al Johnson 2013-04-12 03:10:56 UTC
Referring to the "embed in field" and "holds template" fields.

I use this functionality to allow the user to select a subset of fields to complete on a form based on a dropdown selection, e.g., published work citations (news, journal, book, etc.).  But, the requirement to keep the selector dropdown at the bottom of the form (below the templates that use it) isn't standard and may look weird to those picky/critical users.  Most users would expect the selector to come first (top-to-bottom, left-to-right).  I'm sure there is a technical reason for the way it is now, but a fix would be nice.
Comment 1 Yaron Koren 2013-04-12 03:27:14 UTC
I'm not sure I fully understand. What's an example of a form definition that you wish were laid out differently?
Comment 2 Al Johnson 2013-04-12 05:46:37 UTC
The instructions for 'embed in field' say:

Note that the template to be embedded must appear after the template in
which it will be embedded.

Which is true because it only works with the dropdown coming after the template that uses it, like so:


{{{for template |CreateRefObject |sourceType={{SusFormType |sourcetype}} }}}
<div class="create-form-section-inner" id="journal-article-form">
===Cite Journal Article===
{{{field |sourceType |holds template |hidden}}}
{| 
! | Author*:
| {{{field|journal-author}}} 
|}
</div>

<div class="create-form-section-inner" id="news-article-form">
===Cite News Article===
{{{field |sourceType |holds template |hidden}}}
{| 
! | News Author*:
| {{{field|news-author}}} 
|}
</div>
{{{end template}}}

{{{for template |SusFormType |embed in field=CreateRefObject[sourceType]
|label=Source Type}}}
{|
! Select the type of source to cite*:
|{{{field|sourcetype|input type=dropdown |default=News Article |values=News
Article, Journal Article,Video |show on select=News Article=>news-article-form;
Journal Article=>journal-article-form; Video=>video-form|mandatory }}}
|}
{{{end template}}}


If you place the "{{{for template |SusFormType..." form first, the templates that use it don't get the value.
Comment 3 Yaron Koren 2013-04-12 15:00:19 UTC
There are two strange things going on in this form:

- You have two "field" tags for the same template field - that's not allowed. (I'm surprised this worked for you.)

- You're embedding a non-multiple-instance template; as far as I know, there's no reason to do that. Why not just add that one field to the "CreateRefObject" template?
Comment 4 Al Johnson 2013-04-12 20:12:13 UTC
You're right.  The strange things are removed and all is well.  Thanks for your patience Yaron.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links