<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://cm2.liecourt.com/index.php?action=history&amp;feed=atom&amp;title=Wiki%3AFeature%2F1531907659</id>
	<title>Wiki:Feature/1531907659 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://cm2.liecourt.com/index.php?action=history&amp;feed=atom&amp;title=Wiki%3AFeature%2F1531907659"/>
	<link rel="alternate" type="text/html" href="https://cm2.liecourt.com/index.php?title=Wiki:Feature/1531907659&amp;action=history"/>
	<updated>2026-04-11T12:44:07Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.14</generator>
	<entry>
		<id>https://cm2.liecourt.com/index.php?title=Wiki:Feature/1531907659&amp;diff=184&amp;oldid=prev</id>
		<title>Maintenance script: Fill database</title>
		<link rel="alternate" type="text/html" href="https://cm2.liecourt.com/index.php?title=Wiki:Feature/1531907659&amp;diff=184&amp;oldid=prev"/>
		<updated>2020-05-13T19:24:55Z</updated>

		<summary type="html">&lt;p&gt;Fill database&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Feature&lt;br /&gt;
|Name=Multiple instance templates&lt;br /&gt;
|Purpose=This feature has a template for easily adding a part with multiple-instance templates to a WSForm. The feature page is also used for documentation describing the javascript that is part of this feature.&lt;br /&gt;
|Module=Wiki:Module/1530870565&lt;br /&gt;
|Version=1.0&lt;br /&gt;
|Status=Concept&lt;br /&gt;
|Type=Basic&lt;br /&gt;
|Version notes=1.0 - First version&lt;br /&gt;
|Additional information=&amp;lt;h3&amp;gt;Installing this feature&amp;lt;/h3&amp;gt;&lt;br /&gt;
* Import the list of pages belonging to this feature&lt;br /&gt;
* Add the following code to [[MediaWiki:Common.js]]. Note that it will also work if you only have multipleInstanceTemplates.js without WSShowOnSelect.js, if you do not want to use the Show on select feature. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/* ***** Loading multipleInstanceTemplates and WSShowOnSelect ***** */&lt;br /&gt;
	if ($('.WSmultipleTemplateWrapper') &amp;amp;&amp;amp; !$('.WSShowOnSelect')) {&lt;br /&gt;
		$.getScript('/wikis/modules/wsbasics/multipleInstanceTemplates.js');&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
if ($('.WSShowOnSelect') &amp;amp;&amp;amp; !$('.WSmultipleTemplateWrapper')) {&lt;br /&gt;
	$.getScript('https://i.wikibase.nl/wikis/modules/wsbasics/WSShowOnSelect.js').done(function() {&lt;br /&gt;
		WsShowOnSelect();&lt;br /&gt;
	});&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
if ( $('.WSShowOnSelect') &amp;amp;&amp;amp; $('.WSmultipleTemplateWrapper')) {&lt;br /&gt;
	$.getScript('https://i.wikibase.nl/wikis/modules/wsbasics/WSShowOnSelect.js').done(function() {&lt;br /&gt;
		WsShowOnSelect();&lt;br /&gt;
		$.getScript('/wikis/modules/wsbasics/multipleInstanceTemplates.js').done(function() {&lt;br /&gt;
			WsShowOnSelect();&lt;br /&gt;
		});&lt;br /&gt;
	});&lt;br /&gt;
}&lt;br /&gt;
/* ----- end of Loading multipleInstanceTemplates and WSShowOnSelect ----- */&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* For sortable instances also add:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/******* For sortable elements *****************/ &lt;br /&gt;
if ($('.ws-sortable-items')[0]) {&lt;br /&gt;
  $.getScript('https://cdn.jsdelivr.net/npm/sortablejs@latest/Sortable.min.js').done(function() {&lt;br /&gt;
    $('.ws-sortable-items').each(function () {&lt;br /&gt;
	var sortable = Sortable.create(this, {&lt;br /&gt;
		animation: 150&lt;br /&gt;
	});&lt;br /&gt;
    });&lt;br /&gt;
  });&lt;br /&gt;
}&lt;br /&gt;
/* ---------End of Sortable elements js ---------- */&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Also get the multipleInstanceTemplates.js file from the ws1 server, it's located in the folder wikis/modules/wsbasics. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;&amp;quot;Required&amp;quot; form fields&amp;lt;/h3&amp;gt;&lt;br /&gt;
When you add required form fields in the &amp;quot;Instance&amp;quot; parameter of [[Template:Multiple template formfields]], they will be required for each instance that is added. However this can cause issues with submitting, because one hidden instance is created that is copied when adding new instances. This instance will also have required fields, but they will be hidden and not filled by the user. This would make it impossible to submit the form when there are required fields. Because of this, the save function removes the required attribute from fields in the hidden instance.&lt;br /&gt;
&lt;br /&gt;
As a result of this, it is technically possible for users to circumvent required form-fields in the following way, so we might need a better solution at some point:&lt;br /&gt;
* Add new instances, do not fill required fields&lt;br /&gt;
* Press the submit button, this removes required from the hidden instance&lt;br /&gt;
* Add new instances, these are new copies of the hidden instance and therefore will not have the required attribute&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
		
	</entry>
</feed>