Content deleted Content added
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
<noinclude> |
<noinclude> |
||
Template for quickly creating more pages like the dynamic portal you're in: |
|||
== Usage == |
|||
The template needs the portal inforamtion to be passed in order to get the relevant attributes: |
|||
| ⚫ | |||
|form=Form name (required) |
|||
|template=if null gets form name value |
|||
|namespace=defaults for other NS that that of the existing page |
|||
|main-field=(required) |
|||
|main-field-value=(required) |
|||
|secondary-template=if null gets main template |
|||
|secondary-field=optional |
|||
|secondary-field-value=optional |
|||
|third-template=if null gets main template |
|||
|third-field=optional |
|||
|third-field-value=optional |
|||
}}</pre> |
|||
=== Example === |
|||
<pre>{{CreateLikeThis |
|||
|form=Contact |
|||
|namespace=User |
|||
|main-field=field_company |
|||
|main-field-value=openfox |
|||
|secondary-field=field_avatar |
|||
|secondary-field-value=JustLogo.svg |
|||
}}</pre> |
|||
=== Result === |
|||
{{CreateLikeThis |
|||
|form=Contact |
|||
|namespace=User |
|||
|main-field=field_company |
|||
|main-field-value=openfox |
|||
|secondary-field=field_avatar |
|||
|secondary-field-value=JustLogo.svg |
|||
}} |
|||
| ⚫ | |||
</noinclude><includeonly><btn data-toggle="modal" data-target="#createpage" class="fal fa-plus fa-only-child fox-btn btn-purple-b"> {{:mediawiki:Create-like}}</btn> |
</noinclude><includeonly><btn data-toggle="modal" data-target="#createpage" class="fal fa-plus fa-only-child fox-btn btn-purple-b"> {{:mediawiki:Create-like}}</btn> |
||
<div class="modal fade" id="createpage" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> |
<div class="modal fade" id="createpage" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> |
||
| Line 11: | Line 46: | ||
<btn class="close" data-dismiss="modal" aria-label="Close">|<span aria-hidden="true">×</span></btn> |
<btn class="close" data-dismiss="modal" aria-label="Close">|<span aria-hidden="true">×</span></btn> |
||
</div> |
</div> |
||
<div class="modal-body">{{#forminput:form={{{form|}}}|size=|default value={{{default value|}}}|button text={{:mediawiki:create}}|query string= |
<div class="modal-body">{{#forminput:form={{{form|}}}|size=20|default value={{{default value|}}}|button text={{:mediawiki:create}}|query string={{#if: {{{template|}}}|{{#if:{{{main-field|}}}|{{{template}}}[{{{main-field}}}]={{{main-field-value}}} |
||
}}{{#if:{{{secondary-field|}}}|&{{{secondary-template|{{{template}}}}}}[{{{secondary-field}}}]={{{secondary-field-value}}} |
|||
}}{{#if:{{{third-field|}}}|&{{{third-template|{{{template}}}}}}[{{{third-field}}}]={{{third-field-value}}} |
|||
}} }}|placeholder={{:mediawiki:Create}} {{lc:{{{form}}}}}|namespace={{NAMESPACE}}}} |
|||
</div> |
</div> |
||
<div class="modal-footer"> |
<div class="modal-footer"> |
||
Revision as of 16:09, 12 August 2022
Template for quickly creating more pages like the dynamic portal you're in:
Usage
The template needs the portal inforamtion to be passed in order to get the relevant attributes:
{{CreateLikeThis
|form=Form name (required)
|template=if null gets form name value
|namespace=defaults for other NS that that of the existing page
|main-field=(required)
|main-field-value=(required)
|secondary-template=if null gets main template
|secondary-field=optional
|secondary-field-value=optional
|third-template=if null gets main template
|third-field=optional
|third-field-value=optional
}}Example
{{CreateLikeThis
|form=Contact
|namespace=User
|main-field=field_company
|main-field-value=openfox
|secondary-field=field_avatar
|secondary-field-value=JustLogo.svg
}}Result
<btn data-toggle="modal" data-target="#createpage" class="fal fa-plus fa-only-child fox-btn btn-purple-b"> Create more pages in </btn>