Template:CreateLikeThis: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 38: Line 38:
}}
}}


</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">
</noinclude><includeonly><btn data-toggle="modal" data-target="#createpage" class="fal fa-plus fa-only-child fox-btn btn-purple-b"><nowiki> </nowiki>{{:mediawiki:Create-like}}</btn><div class="modal fade" id="createpage" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-content">
Line 45: Line 45:
<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|}}}|{{lcfirst:{{{template|{{{form}}}}}}}}[{{{main-field}}}]={{{main-field-value}}}
<div class="modal-body">{{#forminput:form={{{form|}}}|size=30|default value={{{default value|}}}|button text={{:mediawiki:create}}|query string={{#if: {{{template|{{{form|}}}}}}|{{#if:{{{main-field|}}}|{{lcfirst:{{{template|{{{form}}}}}}}}[{{{main-field}}}]={{{main-field-value}}}
}}{{#if:{{{secondary-field|}}}|&{{lcfirst:{{{secondary-template|{{{template|{{{form}}}}}}}}}}}[{{{secondary-field}}}]={{{secondary-field-value}}}
}}{{#if:{{{secondary-field|}}}|&{{lcfirst:{{{secondary-template|{{{template|{{{form}}}}}}}}}}}[{{{secondary-field}}}]={{{secondary-field-value}}}
}}{{#if:{{{third-field|}}}|&{{{third-template|{{lcfirst:{{{template|{{{form}}}}}}}}}}}[{{{third-field}}}]={{{third-field-value}}}
}}{{#if:{{{third-field|}}}|&{{{third-template|{{lcfirst:{{{template|{{{form}}}}}}}}}}}[{{{third-field}}}]={{{third-field-value}}}

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