Difference between revisions of "Template:RP Logs"
(8 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<noinclude>== Usage == | <noinclude>== Usage == | ||
<pre> | <pre> | ||
− | {{ RP_Logs<|date> }} | + | {{ RP_Logs<|date><|cols=#> }} |
</pre> | </pre> | ||
Line 22: | Line 22: | ||
+ | <pre> | ||
+ | {{ RP_Logs|cols=3 }} | ||
+ | </pre> | ||
+ | |||
+ | Bulleted, no date, three columns. | ||
+ | |||
+ | |||
+ | <pre> | ||
+ | {{ RP_Logs|date|cols=2 }} | ||
+ | </pre> | ||
+ | No bullet, date shown, two columns. | ||
=== Advanced Usage === | === Advanced Usage === | ||
Some people prefer to put descriptions of the logs, or otherwise adjust the way they're displayed. If you wish to do this, create a page called YourName/AdvLog (i.e., if you're Bob, it would be Bob/AdvLog) and put your version there. <!--For an example, feel free to look at [[Petra/AdvLog]] (currently done by hand) or [[Jai/AdvLog]] (currently done using the [[Template:LogList|LogList]] template) -- but please don't change them, of course!//--> Examples will be forthcoming. Any log to which you link on your AdvLog page will be removed from the automatic list, so that you'll get a list beneath your edited version of only any logs you're in, but haven't yet added to your edited list. | Some people prefer to put descriptions of the logs, or otherwise adjust the way they're displayed. If you wish to do this, create a page called YourName/AdvLog (i.e., if you're Bob, it would be Bob/AdvLog) and put your version there. <!--For an example, feel free to look at [[Petra/AdvLog]] (currently done by hand) or [[Jai/AdvLog]] (currently done using the [[Template:LogList|LogList]] template) -- but please don't change them, of course!//--> Examples will be forthcoming. Any log to which you link on your AdvLog page will be removed from the automatic list, so that you'll get a list beneath your edited version of only any logs you're in, but haven't yet added to your edited list. | ||
[[Category:Template]] | [[Category:Template]] | ||
− | </noinclude><includeonly>{{#css: | + | </noinclude><includeonly>{{#vardefine:rows|{{{rows|100}}}}}{{#vardefine:year|0000}}{{#vardefine:block|1}}{{#vardefine:lognum|1}}{{#vardefine:thePage|{{#ifeq:{{{special}}}|all||{{#titleparts: {{PAGENAME}} | 1 | 1}} }} }}{{#dplvar:set|logLevel|{{#ifexist: {{#var:thePage}}/AdvLog|Adv|Bas}} }}{{#ifeq: {{#dplvar:logLevel}} | Adv |{{:{{#var:thePage}}/AdvLog}}| }}{{#dplvar:set|checkIt|{{uc:{{{1}}}}}}}{{#ifeq:{{#dplvar:checkIt}}|DATE|{{#dplvar:set|useDates|true}}|}}{{#css: |
.loglist ul { | .loglist ul { | ||
margin: 0; | margin: 0; | ||
Line 31: | Line 42: | ||
} | } | ||
.loglist.cols { | .loglist.cols { | ||
− | columns: 275px {{{cols|1}}}; | + | columns: {{#ifeq:{{#dplvar:useDates}}|true|275px|200px}} {{{cols|1}}}; |
column-gap: 2em; | column-gap: 2em; | ||
width: 100%; | width: 100%; | ||
Line 37: | Line 48: | ||
.loglist.cols .listedlogs { | .loglist.cols .listedlogs { | ||
white-space: nowrap; | white-space: nowrap; | ||
+ | } | ||
+ | .loglist.cols .log { | ||
+ | width: 275px; | ||
+ | overflow: hidden; | ||
+ | text-overflow: ellipsis; | ||
} | } | ||
.loglist.cols .pager { | .loglist.cols .pager { | ||
Line 53: | Line 69: | ||
display: block; | display: block; | ||
} | } | ||
− | + | }}{{#arraydefine:loglist|{{#regex:{{#regexall:{{#dpl: | |
| namespace= | | namespace= | ||
| linksto={{#var:thePage}} | | linksto={{#var:thePage}} | ||
Line 69: | Line 85: | ||
| resultsheader={{#ifeq: {{#dplvar:logLevel}} | Adv | <center>'''Also:'''</center> \n| }} | | resultsheader={{#ifeq: {{#dplvar:logLevel}} | Adv | <center>'''Also:'''</center> \n| }} | ||
}}|/(\d{10}.+\^)/U|`}}|/\^/|}}|`|sort=asc}} | }}|/(\d{10}.+\^)/U|`}}|/\^/|}}|`|sort=asc}} | ||
− | <div class="loglist {{#if:{{{cols|}}}|cols|}}">{{#ifeq:{{#dplvar:useDates}}|true|<div|<ul}} class="listedlogs" id="Block1">{{#arrayprint:loglist||@@@@|{{#arraydefine:log|@@@@|~}}{{#ifeq:{{{years}}}|yes|{{#ifeq:{{#vardefineecho:newyear|{{#regex:{{#arrayindex:log|1}}|/\d{4}/}}}}|{{#var:year}}||<h2>{{#vardefineecho:year|{{#var:newyear}}}}</h2>}}|}}{{#ifeq:{{#dplvar:useDates}}|true|{{#arrayindex:log|1}}:|<li>}} [[{{#arrayindex:log|4}}|<span title="{{#regex:{{#regex:{{#arrayindex:log|3}}|/\[\[ | + | <div class="loglist {{#if:{{{cols|}}}|cols|}}">{{#ifeq:{{#dplvar:useDates}}|true|<div|<ul}} class="listedlogs" id="Block1">{{#arrayprint:loglist||@@@@|{{#arraydefine:log|@@@@|~}}{{#ifeq:{{{years}}}|yes|{{#ifeq:{{#vardefineecho:newyear|{{#regex:{{#arrayindex:log|1}}|/\d{4}/}}}}|{{#var:year}}||<h2>{{#vardefineecho:year|{{#var:newyear}}}}</h2>}}|}}{{#ifeq:{{#dplvar:useDates}}|true|<div class="log">{{#arrayindex:log|1}}:|<li>}} [[{{#arrayindex:log|4}}|<span title="{{#regex:{{#regex:{{#regex:{{#arrayindex:log|3}}|/\[\[(.+)\x7C(.+)\]\]/|$2}}|/\[\[(.+)\]\]/|$1}}|/"/|"}}">{{#arrayindex:log|5}}</span>]]{{#ifeq:{{#dplvar:useDates}}|true|</div>|</li>}}{{#vardefine:lognum|{{#expr:{{#var:lognum}}+1}}}}{{#ifexpr:{{#var:lognum}}>{{#var:rows}}|<div class="pager">{{#ifeq:{{#var:block}}|1||<span class="less">[[#Block{{#expr:{{#var:block}}-1}}|[less]]]</span>}}<span class="total">{{#expr:({{#var:block}}-1)*{{#var:rows}}+1}}-{{#expr:{{#var:block}}*{{#var:rows}}}} of {{#vardefineecho:total|{{#arraysize:loglist}}}}</span>{{#ifexpr:{{#var:block}}*{{#var:rows}}>={{#var:total}}||<span class="more">[[#Block{{#vardefineecho:block|{{#expr:{{#var:block}}+1}}}}|[more]]]</span>}}</div>{{#vardefine:lognum|1}}{{#ifeq:{{#dplvar:useDates}}|true|</div><div|</ul><ul}} class="listedlogs" id="Block{{#var:block}}">|}}}}{{#ifeq:{{#dplvar:useDates}}|true|</div>|</ul>}}</div>{{#ifeq:{{#arraysize:loglist}}|0|None yet! Why not check out the [[Template:Log|Log]] template and add some?}}</includeonly> |
Latest revision as of 16:42, 15 April 2018
Usage
{{ RP_Logs<|date><|cols=#> }}
This template will automagically generate a list of all logs which link to the name of the page, in order from oldest to newest.
This is an adjustment of the similar template from Masquerade, which was itself based on the idea and a version of code from Haunted Memories.
Examples
{{ RP_Logs }}
The basic, default list. Bulleted, no date shown.
{{ RP_Logs|date }}
No bullet, date shown.
{{ RP_Logs|cols=3 }}
Bulleted, no date, three columns.
{{ RP_Logs|date|cols=2 }}
No bullet, date shown, two columns.
Advanced Usage
Some people prefer to put descriptions of the logs, or otherwise adjust the way they're displayed. If you wish to do this, create a page called YourName/AdvLog (i.e., if you're Bob, it would be Bob/AdvLog) and put your version there. Examples will be forthcoming. Any log to which you link on your AdvLog page will be removed from the automatic list, so that you'll get a list beneath your edited version of only any logs you're in, but haven't yet added to your edited list.