Testpage8: verschil tussen versies
Uit Auditpedia
(Tekst vervangen door "what") Label: Vervangen |
|||
Regel 1: | Regel 1: | ||
− | + | <noinclude>{{Managed | |
+ | |Version=1.0 | ||
+ | |Version notes=1.0 - First managed version | ||
+ | |Short description=Form to create/edit articles | ||
+ | }} | ||
+ | |||
+ | This is the '''Article form''' template. It should be called in the following format: | ||
+ | |||
+ | <pre> | ||
+ | {{Article form | ||
+ | |Page= < Optional > if empty, a new page is created | ||
+ | |||
+ | "Template:Article" parameters: | ||
+ | |Title= | ||
+ | |Portal= < comma-separated pages > | ||
+ | |Archived= < Optional: Yes > | ||
+ | }} | ||
+ | </pre> | ||
+ | |||
+ | </noinclude><includeonly><wsform action="addToWiki"><!-- | ||
+ | |||
+ | // If Page parameter has a value, create that page, else create a new one | ||
+ | -->{{#if:{{{Page|}}} | ||
+ | |<wscreate mwwrite="{{{Page|}}}" mwtemplate="Article" /> | ||
+ | |<wscreate mwwrite="Article/[Title]" mwtemplate="Article" mwfields="Title, Portal, Author article" mwfollow /> | ||
+ | }} | ||
+ | <wslabel>{{int: ws-title}}:</wslabel> | ||
+ | <wsfield name="Title" type="text" value="{{{Title|}}}" class="form-control row-formitemresponsive" required="required" /> | ||
+ | |||
+ | {{Item responsive |Cols={{#var:@cols|4-8}} | ||
+ | |1=Portal | ||
+ | |2= | ||
+ | {{#arraydefine:$portals |{{#ask:[[Class::Portal]] |limit=999 |link=none |sort=Title }} }} | ||
+ | |||
+ | {{#arraydefine:$portals selected |{{{Portal|}}} }}<!-- | ||
+ | -->{{#arraydiff:$portals unselected |$portals |$portals selected}}<!-- | ||
+ | --><wstoken id="portal-tokens" multiple required="required" name="Portal[]" ><wsfield type="option" value=""/> | ||
+ | {{#arraymap:{{#arrayprint:$portals selected}} |,|__Portal__|{{#tag:wsfield |{{#show:__Portal__ |?Title}} |type=option |value=__Portal__ |selected=selected }} |}} | ||
+ | {{#arraymap:{{#arrayprint:$portals unselected}} |,|__Portal__|{{#tag:wsfield |{{#show:__Portal__ |?Title}} |type=option |value=__Title__}} |}} | ||
+ | </wstoken>}} | ||
+ | |||
+ | <div class="text-right"> | ||
+ | {{#if:{{{Page|}}} ||{{#widget:Button link | ||
+ | |class=btn btn-default | ||
+ | |href=#article-form | ||
+ | |datatoggle=collapse | ||
+ | |buttontext={{int: ws-back}} | ||
+ | }} | ||
+ | }} | ||
+ | <wsfield type="submit" class="btn btn-primary" value="{{int: ws-save}}" /> | ||
+ | </div> | ||
+ | </wsform></includeonly> |
Versie van 5 jan 2021 11:30
This is the Article form template. It should be called in the following format:
{{Article form |Page= < Optional > if empty, a new page is created "Template:Article" parameters: |Title= |Portal= < comma-separated pages > |Archived= < Optional: Yes > }}