Doctor Who Cuttings Archive

Difference between revisions of "Template:Article"

From The Doctor Who Cuttings Archive
Jump to navigationJump to search
 
(219 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<includeonly>  
 
<includeonly>  
 +
<!--'''{{PAGENAME}}''' ({{#sub:{{{date}}}|0|4}})<br /><br />  don't need this with new skin-->
 +
<!-- Hidden categories and set properties -->
 +
{{#if: {{{file}}} | | [[Category:Articles with no image]]No image available.  {{#if: {{{text}}} | However there is a {{#switchtablink:Text|transcription}} available.}}{{#if: {{{abstract|}}} | | <br /><br /><span class='NoPrint'>Do you have an image?  Email us: {{email}}</span> }} }}{{#if: {{{text}}} | | [[Category:Articles with no OCR]] }} {{#if: {{{date}}} | [[Category:Articles published in {{#sub:{{{date}}}|0|4}}]] {{#set: Has DatePublished = {{{date}}} }} | }}
 +
{{#ifeq: {{#sub:{{{file}}}|-3}} | jpg | [[Image:{{{file}}}|link={{filepath:{{{file}}} }}|{{{px|250}}}px]]
 +
*{{filepath:{{{file}}} }} {{#set:Has Image={{filepath: {{{file}}} }} }} | }}
 +
{{#ifeq: {{#sub:{{{file}}}|-3}} | pdf | {{Google Docs Viewer|url={{{file}}}|float=|height={{{height|500}}}|width={{{width|500}}} }}*{{{file}}}
 +
*[[Browser issues|pdf help]] {{#set:Has Image={{{file}}} }} | }}
 +
<div style="clear:right;">
 
= Description =  
 
= Description =  
*Publication: {{{publication}}}
+
*'''Publication:''' [[Has Publication::{{{publication}}}]]
*Date: {{{date}}}
+
*'''Date:''' {{#if: {{{date}}} | [[:Category:Articles published in {{#sub: {{{date}}}|0|4}}|{{{display date|{{{date}}}}}}]] | }}
*Author: {{{author}}}
+
*'''Author:''' {{{author}}}
*Page: {{{pages}}}
+
*'''Page:''' {{{pages}}}
*Type: {{{type}}}
+
*'''Language:''' {{{language|English}}}{{#if: {{{description}}} |
*Description: {{{description}}}
+
*'''Notes:''' {{{description}}} }}{{#if: {{{abstract|}}} |
 +
*'''Abstract:''' {{{abstract}}} }}
  
 
{{#if: {{{text}}} | = Text =
 
{{#if: {{{text}}} | = Text =
{{{text}}} | }}
+
{{{text}}} {{#vardefine:lang | {{LanguageCode|{{{language}}} }} }}
 +
{{#ifeq: {{#var:lang}} | en | |
 +
*[https://translate.google.com/?sl={{#var:lang}}&tl=en&text={{urlencode:{{{text}}} }} Google Translate] }} | }}
  
= Citation =
+
= Citations =
  
 
''Disclaimer'': These citations are created on-the-fly using primitive parsing techniques.  You should double-check '''all''' citations.  Send feedback to {{email}}
 
''Disclaimer'': These citations are created on-the-fly using primitive parsing techniques.  You should double-check '''all''' citations.  Send feedback to {{email}}
  
 +
* '''APA 6th ed.''': {{#if: {{{author|}}} | {{InvertName|{{{author}}}}} | }} ({{{display date|{{{date}}}}}}). {{ARTICLEPAGENAME}}. ''{{{publication}}}'' {{#if: {{{pages}}} | p. {{{pages}}}. | . }}
 +
* '''MLA 7th ed.''': {{#if: {{{author|}}} | {{InvertName|{{{author}}}}}. | }} "{{ARTICLEPAGENAME}}." {{{publication}}} [add city] {{{display date|{{{date}}}}}}{{#if: {{{pages}}} | , {{{pages}}}. | . }} Print.
 +
* '''Chicago 15th ed.''': {{#if: {{{author|}}} | {{InvertName|{{{author}}}}}. | }} "{{ARTICLEPAGENAME}}." {{{publication}}}, edition, sec., {{{display date|{{{date}}}}}}
 +
* '''Turabian''': {{#if: {{{author}}} | {{InvertName|{{{author}}}}}. | }} "{{ARTICLEPAGENAME}}." ''{{{publication}}}'', {{{display date|{{{date}}}}}}, section, {{{pages|}}} edition.
 +
* '''Wikipedia (this article)''': <nowiki><ref>{{</nowiki>cite news| title={{ARTICLEPAGENAME}} | url=<nowiki>http://cuttingsarchive.org/index.php/</nowiki>{{FULLPAGENAMEE}} | work={{{publication}}} | pages={{{pages}}} | date={{{display date|{{{date}}}}}} | via=Doctor Who Cuttings Archive | accessdate={{CURRENTDAY}} {{CURRENTMONTHNAME}} {{CURRENTYEAR}} <nowiki>}}</ref></nowiki>
 +
* '''Wikipedia (this page)''': <nowiki><ref>{{</nowiki>cite web | title={{ARTICLEPAGENAME}} | url=<nowiki>http://cuttingsarchive.org/index.php/</nowiki>{{FULLPAGENAMEE}} | work=Doctor Who Cuttings Archive | accessdate={{CURRENTDAY}} {{CURRENTMONTHNAME}} {{CURRENTYEAR}}<nowiki>}}</ref></nowiki>
 +
{{#if: {{{moreTitles|}}}
 +
|= Additional versions =
  
* '''APA 6th ed.''': {{{author|}}} ({{{date}}}). {{ARTICLEPAGENAME}}. ''{{{publication}}}'' {{#if: {{{pages}}} | p. {{{pages}}}. | . }}
+
{{#arraydefine:t|{{{moreTitles}}}|,|}}
* '''MLA 7th ed.''': {{{author|}}}. "{{ARTICLEPAGENAME}}." {{{publication}}} [add city] {{{date}}}{{#if: {{{pages}}} | , {{{pages}}}. | . }} Print.
+
{{#arraydefine:p|{{{morePublications}}}|,|}}
* '''Chicago 15th ed.''': {{#if: {{{author}}} | {{{author}}}. | }} "{{ARTICLEPAGENAME}}." {{{publication}}}, edition, sec., {{{date}}}
+
{{#arraydefine:d|{{{moreDates}}}|,|}}
* '''Turabian''': {{#if: {{{author}}} | {{{author}}}. | }} "{{ARTICLEPAGENAME}}." ''{{{publication}}}'', {{{date}}}, section, {{{pages|}}} edition.
+
{{
* '''Wikipedia''': <nowiki><ref>{{</nowiki>cite web | title={{ARTICLEPAGENAME}} | newspaper={{{publication}}} | pages={{{pages}}} | date={{{date}}}<nowiki>}}</ref></nowiki>
+
  #loop: x
* '''Wikipedia (this page)''': <nowiki><ref>{{</nowiki>cite news | title={{ARTICLEPAGENAME}} | url=<nowiki>http://cuttingsarchive.org/index.php/</nowiki>{{FULLPAGENAME}} | work=The Doctor Who Cuttings Archive | accessdate={{CURRENTDAY}} {{CURRENTMONTHNAME}} {{CURRENTYEAR}}<nowiki>}}</ref></nowiki>
+
  | 0
<headertabs />
+
  | {{#arraysize:t}}  
 
+
  |  
<!-- Hidden categories and set properties -->
+
<ul>
{{#if: {{{text}}}    | | [[Category:Articles with no OCR]]  }}
+
<li>'''Title:''' {{#arrayindex:t|{{#var:x}}}}</li>
{{#if: {{{filename}}} | | [[Category:Articles with no image]] }}
+
<li>'''Publication:''' [[Has Publication::{{#arrayindex:p|{{#var:x}}}}]]</li>
{{#ifeq: {{{type}}}  | obituary | [[Category:Obituaries]] | }}
+
<li>'''Date:''' {{#arrayindex:d|{{#var:x}}}}</li>
{{#if: {{{date}}}    | [[Category:Articles published in {{#sub:{{{date}}}|0|4}}]] {{#set:Has DatePublished={{#sub:{{{date}}}|0|4}} }} | }}
+
</ul><br />  
 +
}}
 +
|
 +
}}
 +
<headertabs /></div>
  
 
<!-- Categories from template -->
 
<!-- Categories from template -->
{{#arraydefine:Cats|{{{Categories}}}|,|options}}
+
{{#if: {{{categories}}} | {{#arraydefine:Cats|{{{categories}}} }} }}
{{#arrayprint:Cats |<br/> | @@@@ |[[Category:@@@@]] }}
+
{{#if: {{{categories}}} | {{#arrayprint:Cats | | @@@@ |[[Category:@@@@]] }} }}
 
+
{{DS}}__NOTOC__
{{DS}}
 
{{#set:[[Has type::Article]]}}
 
 
[[Category:Articles]]
 
[[Category:Articles]]
 
</includeonly>
 
</includeonly>
<noinclude>
+
<noinclude>  
{{jpg<br />
+
{{article<br />
|filename =<br />
+
| publication      = <br />
|px =<br />
+
| file              = <br />
}}  
+
| px               = <br />
 +
| height            = <br />
 +
| width            = <br />
 +
| date              = <br />
 +
| author            = <br />
 +
| pages            = <br />
 +
| language          = English<br />
 +
| type              = <br />
 +
| description      = <br />
 +
| categories        = <br />
 +
| moreTitles        = <br />
 +
| morePublications  = <br />
 +
| moreDates        = <br />
 +
| text              = <br />
 +
}}
 +
 
 +
<pre>{{Image table
 +
|{{img||px|}}
 +
|{{img||px|}}
 +
|{{img||px|}}
 +
|{{img||px|}}
 +
|{{img||px|}}
 +
}}
  
{{Google Docs Viewer<br />
+
Sub filetoCuttings()
|url=<br />
 
|float=|height=|width=|top caption=|bottom caption=}}<br />
 
  
{{article<br />
+
    Application.DisplayAlerts = wdAlertsNone
| publication =<br />
+
   
| date       =<br />
+
    Selection.WholeStory
| author     =<br />
+
    With Selection.Find
| pages       =<br />
+
        .ClearFormatting
| type       =<br />
+
        .Replacement.ClearFormatting
| description =<br />
+
        .Text = "File:"
| text       =<br />
+
        .Replacement.Text = ""
}}
+
        .Forward = True
 +
        .Wrap = wdFindAsk
 +
        .Format = False
 +
        .MatchCase = False
 +
        .MatchWholeWord = False
 +
        .MatchWildcards = False
 +
        .MatchSoundsLike = False
 +
        .MatchAllWordForms = False
 +
        .Execute Replace:=wdReplaceAll
 +
       
 +
        .Text = "^p"
 +
        .Replacement.Text = ""
 +
        .Forward = True
 +
        .Wrap = wdFindAsk
 +
        .Format = False
 +
        .MatchCase = False
 +
        .MatchWholeWord = False
 +
        .MatchWildcards = False
 +
        .MatchSoundsLike = False
 +
        .MatchAllWordForms = False
 +
        .Execute Replace:=wdReplaceAll
 +
    End With
 +
 
 +
    Selection.WholeStory
 +
    FName = Selection
 +
   
 +
    FName = Trim(FName)
 +
    ftype = Mid(FName, Len(FName) - 3, 3)
 +
    FName = Left(FName, Len(FName) - 5)
 +
   
 +
    pos = InStr(FName, " ")
 +
    fdate = Left(FName, pos - 1)
 +
    FName = Mid(FName, pos + 1)
 +
    p = Right(FName, 3)
 +
    p = Trim(p)
 +
    If p Like "p#" Then
 +
        p = Right(p, 1)
 +
        FName = Left(FName, Len(FName) - 3)
 +
    ElseIf p Like "p##" Then
 +
        p = Right(p, 2)
 +
        FName = Left(FName, Len(FName) - 4)
 +
    Else
 +
        p = ""
 +
    End If
 +
       
 +
    out = "{{article" & vbCrLf & "| publication = " & FName & vbCrLf
 +
    out = out & "| file = " & fdate & " " & FName & "." & ftype & vbCrLf
 +
    out = out & "| px = "
 +
    If ftype = "jpg" Then out = out & "450"
 +
    out = out & vbCrLf & "| height = " & vbCrLf
 +
    out = out & "| width = " & vbCrLf & "| date = " & fdate & vbCrLf
 +
    If Len(fdate) < 10 Then out = out & "| display date = " & vbCrLf
 +
    out = out & "| author = " & vbCrLf & "| pages = " & p & vbCrLf & "| language = English " & vbCrLf
 +
    out = out & "| type = " & vbCrLf & "| description = " & vbCrLf & "| categories = " & vbCrLf
 +
    out = out & "| moreTitles = " & vbCrLf & "| morePublications = " & vbCrLf & "| moreDates = " & vbCrLf
 +
    out = out & "| text = " & vbCrLf & "}}"
 +
   
 +
    Selection.TypeText (out)
 +
    Application.DisplayAlerts = wdAlertsAll
 +
End Sub
 +
 
 +
</pre>
 
</noinclude>
 
</noinclude>

Latest revision as of 02:17, 21 December 2021


{{article
| publication =
| file =
| px =
| height =
| width =
| date =
| author =
| pages =
| language = English
| type =
| description =
| categories =
| moreTitles =
| morePublications =
| moreDates =
| text =
}}

{{Image table
|{{img||px|}}
|{{img||px|}}
|{{img||px|}}
|{{img||px|}}
|{{img||px|}}
}}

Sub filetoCuttings()

    Application.DisplayAlerts = wdAlertsNone
    
    Selection.WholeStory
    With Selection.Find
        .ClearFormatting
        .Replacement.ClearFormatting
        .Text = "File:"
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindAsk
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
        .Execute Replace:=wdReplaceAll
        
        .Text = "^p"
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindAsk
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
        .Execute Replace:=wdReplaceAll
    End With

    Selection.WholeStory
    FName = Selection
    
    FName = Trim(FName)
    ftype = Mid(FName, Len(FName) - 3, 3)
    FName = Left(FName, Len(FName) - 5)
    
    pos = InStr(FName, " ")
    fdate = Left(FName, pos - 1)
    FName = Mid(FName, pos + 1)
    p = Right(FName, 3)
    p = Trim(p)
    If p Like "p#" Then
        p = Right(p, 1)
        FName = Left(FName, Len(FName) - 3)
    ElseIf p Like "p##" Then
        p = Right(p, 2)
        FName = Left(FName, Len(FName) - 4)
    Else
        p = ""
    End If
        
    out = "{{article" & vbCrLf & "| publication = " & FName & vbCrLf
    out = out & "| file = " & fdate & " " & FName & "." & ftype & vbCrLf
    out = out & "| px = "
    If ftype = "jpg" Then out = out & "450"
    out = out & vbCrLf & "| height = " & vbCrLf
    out = out & "| width = " & vbCrLf & "| date = " & fdate & vbCrLf
    If Len(fdate) < 10 Then out = out & "| display date = " & vbCrLf
    out = out & "| author = " & vbCrLf & "| pages = " & p & vbCrLf & "| language = English " & vbCrLf
    out = out & "| type = " & vbCrLf & "| description = " & vbCrLf & "| categories = " & vbCrLf
    out = out & "| moreTitles = " & vbCrLf & "| morePublications = " & vbCrLf & "| moreDates = " & vbCrLf
    out = out & "| text = " & vbCrLf & "}}"
    
    Selection.TypeText (out)
    Application.DisplayAlerts = wdAlertsAll
End Sub