Template:CreateLikeThis: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 46: 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=20|default value={{{default value|}}}|button text={{:mediawiki:create}}|query string={{#if: {{{template|{{{form|}}}}}}|{{#if:{{{main-field|}}}|{{{template}}}[{{{main-field}}}]={{{main-field-value}}}
<div class="modal-body">{{#forminput:form={{{form|}}}|size=20|default value={{{default value|}}}|button text={{:mediawiki:create}}|query string={{#if: {{{template|{{{form|}}}}}}|{{#if:{{{main-field|}}}|{{{template|{{{form}}}}}}[{{{main-field}}}]={{{main-field-value}}}
}}{{#if:{{{secondary-field|}}}|&{{{secondary-template|{{{template}}}}}}[{{{secondary-field}}}]={{{secondary-field-value}}}
}}{{#if:{{{secondary-field|}}}|&{{{secondary-template|{{{template|{{{form}}}}}}}}}[{{{secondary-field}}}]={{{secondary-field-value}}}
}}{{#if:{{{third-field|}}}|&{{{third-template|{{{template}}}}}}[{{{third-field}}}]={{{third-field-value}}}
}}{{#if:{{{third-field|}}}|&{{{third-template|{{{template|{{{form}}}}}}}}}[{{{third-field}}}]={{{third-field-value}}}
}} }}|placeholder={{:mediawiki:Create}} {{lc:{{{form}}}}}|namespace={{NAMESPACE}}}}
}} }}|placeholder={{:mediawiki:Create}} {{lc:{{{form}}}}}|namespace={{NAMESPACE}}}}
</div>
</div>

Revision as of 16:11, 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>