{{Documentation subpage}} <!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see Wikipedia:Wikidata) --> {{lua|Module:Selected recent additions}}

This templates transcludes "Did you know?" blurbs on specified topics from the monthly subpages of ZiyoSfera:Recent additions (the ''Did you know?'' archives). It is intended for use in the "Did you know" sections of Portals.

== Usage == <pre style="overflow:auto">{{Transclude selected recent additions | <search pattern 1> | ... | <search pattern n> | not1= | ... | notn= | months= | max= | latest= | none= | more= |header= |footer= }}</pre>

;Basic :<code><nowiki>{{Transclude selected recent additions|</nowiki> ''search pattern'' <nowiki>}}</nowiki></code> ;Multiple search patterns: :<code><nowiki>{{Transclude selected recent additions|</nowiki> ''search pattern'' | ''second search pattern'' | ''third search pattern'' <nowiki>}}</nowiki></code> :Add as many search patterns as needed ;With patterns to exclude items :<code><nowiki>{{Transclude selected recent additions|</nowiki> ''search pattern'' | not=''search pattern to exclude from results'' <nowiki>}}</nowiki></code> :Add additional search patterns to exclude items from results using {{para|not2}}, {{para|not3}}, etc. ;As a portal component which only displays when items are found :<code><nowiki>{{Transclude selected recent additions|</nowiki> header= ''header template'' | footer= ''footer template'' | ''other parameters'' <nowiki>}}</nowiki></code> ;As a suggestion generator, e.g. on the portal talk page :<code><nowiki>{{Transclude selected recent additions|</nowiki> latest=yes | wikitext=yes | ''other parameters'' <nowiki>}}</nowiki></code>

===Parameters=== ;{{para|1}}, {{para|2}}, {{para|3}} ... :Search patterns for items ;{{para|not1}}, {{para|not2}}, {{para|not3}} ... :Search patterns for excluding items ;{{para|months}} :Number of months to search through for items (counting backwards from the current date); default is <code>30</code> (nb. you may find large numbers equal to several years won't work for technical reasons). ;{{para|max}} :Maximum number of items to display; default is <code>6</code> ;{{para|latest}} :Set to <code>yes</code> to display the most recent items; omit this parameter to display a randomised set of items (with new selections when the page is purged) ;{{para|wikitext}} :Set to <code>yes</code> to display the wikitext of the items, e.g. when using this template just to generate suggestions ;{{para|none}} :Wikitext to display if no matching items are found; default is "No recent additions" ;{{para|more}} : Wikitext to show at the bottom of the list; ''OR'' : Set to <code>yes</code> to show '''More recent additions...''' link at the bottom of the list ;{{para|header}} :Wikitext to show above the items; typically {{tlx|Box-header}} or {{tlx|Box-header colour}} or similar (with appropriate parameters filled in) :If set, this template only displays output when items are found (overriding {{para|more}} if set) ;{{para|footer}} :Wikitext to show below the items; defaults to {{tlx|Box-footer}} :Can only be used in conjunction with {{para|header}}

===Search patterns=== Search patterns are Lua patterns, which are similar to regular expressions. This means that <code>^$()%.[]*+-?</code> characters have special meaning, such as <code>.</code> matching any character. To search for those characters themselves, they need to be escaped by prefixing a <code>%</code>

For piped links, both the target article name as well as the displayed text are searched for matches. Images and image captions are not searched for matches.

{{bulb}} '''Tip:''' To make a letter in a search pattern case-insensitive, put both the upper-case and lowercase letter inside square-brackets, i.e. <code>[Aa]pple</code> will match both {{xt|An apple is...}} and {{xt|Apples are...}}.

==Examples== {{{{ROOTPAGENAME}}/doc/examples}}

== See also == {{Portal templates navbox}}

<includeonly>{{sandbox other|| <!-- Categories below this line, please; interwikis at Wikidata -->

}}</includeonly>