Template:Suggestion list/New suggestion
From PCSAR
(Difference between revisions)
(New page: {{subst:template}}) |
|||
(3 intermediate revisions not shown.) | |||
Line 1: | Line 1: | ||
<noinclude>{{documentation}}</noinclude><includeonly><!-- | <noinclude>{{documentation}}</noinclude><includeonly><!-- | ||
- | --><!-- | + | -->{{suggestion number<!-- |
+ | |||
+ | Would like to increment past the last suggestion in the current list | ||
+ | (to handle gaps due to reassigning/deleting). | ||
+ | |||
+ | However absence of string functions makes that very | ||
+ | difficult/impossible to implement with old style of segment names | ||
+ | "Sug1". In those cases, use as a surrogate use count of current | ||
+ | suggestions. | ||
+ | |||
+ | New style name "Sug/0001" can just strip off last segment. | ||
+ | |||
+ | -->|{{#iferror:<!-- | ||
+ | |||
+ | -->{{#expr:<!-- | ||
+ | |||
+ | -->{{#titleparts:<!-- | ||
+ | |||
+ | -->{{#ask: [[Category:suggestion]]<!-- | ||
+ | |||
+ | -->[[Suggestion list::{{FULLPAGENAME}}]]<!-- | ||
+ | |||
+ | -->|format=list<!-- | ||
+ | |||
+ | -->|searchlabel=<!-- | ||
+ | |||
+ | -->|link=none<!-- | ||
+ | |||
+ | -->|sort=Sequence number<!-- | ||
+ | |||
+ | -->|order=reverse<!-- | ||
+ | |||
+ | -->|limit=1<!-- | ||
+ | |||
+ | -->}}<!-- | ||
+ | |||
+ | |||
+ | get just the last segment of the suggestion page name | ||
+ | |||
+ | -->||-1}}<!-- | ||
+ | |||
+ | -->+1}}<!-- | ||
+ | |||
+ | default if error: (caused by "Sug" in segment name not being a simple | ||
+ | number) | ||
+ | |||
+ | -->|{{#expr: {{Suggestion list/Count|{{FULLPAGENAME}}}} + 1 }}<!-- | ||
+ | |||
+ | -->}}<!-- | ||
+ | |||
+ | -->|add a new suggestion<!-- | ||
+ | |||
+ | -->}}<!-- | ||
--></includeonly> | --></includeonly> |
Current revision
This is the documentation for the template Template:Suggestion list/New suggestion
The template [edit] Supporting templates |
To see how this template is implemented,
edit this page and examine the portion
between <includeonly>
and </includeonly>
.