Module:Citation/CS1: Difference between revisions

fixed args.article to set Title, after Periodical is set from Title; allowed blank Title (as "contribution=mytitle"); fixed ".." in Editors list
m>Wikid77
(ensure "author1-first" also gets args.given or args.given1)
m>Wikid77
(fixed args.article to set Title, after Periodical is set from Title; allowed blank Title (as "contribution=mytitle"); fixed ".." in Editors list)
Line 226: Line 226:
function citation0(frame, args)
function citation0(frame, args)
     local config = frame.args -- the arguments passed BY the template, in the wikitext of the template itself
     local config = frame.args -- the arguments passed BY the template, in the wikitext of the template itself
      
 
     --------------------------------------------------- Get parameters   
     local PPrefix = config.PPrefix or "p. "
     local PPrefix = config.PPrefix or "p. "
     local PPPrefix = config.PPPrefix or "pp. "
     local PPPrefix = config.PPPrefix or "pp. "
Line 274: Line 275:
     local DateIn = Date
     local DateIn = Date
     local LayDate = args.laydate
     local LayDate = args.laydate
    ------------------------------------------------- Get title data
     local Title = args.title or args.encyclopaedia or args.encyclopedia or args.dictionary
     local Title = args.title or args.encyclopaedia or args.encyclopedia or args.dictionary
     local BookTitle = args.booktitle
     local BookTitle = args.booktitle
Line 280: Line 282:
     local TitleNote = args.department
     local TitleNote = args.department
     local TitleLink = args.titlelink or args.episodelink
     local TitleLink = args.titlelink or args.episodelink
     local Chapter = args.chapter or args.contribution or args.article or args.entry
     local Chapter = args.chapter or args.contribution or args.entry
     local ChapterLink = args.chapterlink
     local ChapterLink = args.chapterlink
     local TransChapter = args["trans-chapter"] or args.trans_chapter
     local TransChapter = args["trans-chapter"] or args.trans_chapter
Line 289: Line 291:
     local ConferenceURL = args["conference-url"] or args.conferenceurl
     local ConferenceURL = args["conference-url"] or args.conferenceurl
     local Periodical = args.journal or args.newspaper or args.magazine or args.work or args.periodical or args.encyclopedia or args.encyclopaedia
     local Periodical = args.journal or args.newspaper or args.magazine or args.work or args.periodical or args.encyclopedia or args.encyclopaedia
    if ( args.article and args.article ~= "") then
        if ( Title and Title ~= "") then Periodical = Title end
        Title = args.article
    end
     local Series = args.series or args.version
     local Series = args.series or args.version
     local Volume = args.volume
     local Volume = args.volume
Line 751: Line 757:
     -- Several of the above rely upon detecting this as nil, so do it last.
     -- Several of the above rely upon detecting this as nil, so do it last.
     if ( Periodical ~= nil and Periodical ~="" ) then  
     if ( Periodical ~= nil and Periodical ~="" ) then  
         Periodical = sepc .. " <i>" .. Periodical .. "</i>"
         if ( Title and Title ~= "")
            then Periodical = sepc .. " <i>" .. Periodical .. "</i>"
            else Periodical = "<i>" .. Periodical .. "</i>"
        end
     else Periodical = "" end
     else Periodical = "" end


Line 782: Line 791:
             local in_text = " in "
             local in_text = " in "
             if (sepc == '.') then in_text = " In " end
             if (sepc == '.') then in_text = " In " end
             Editors = in_text .. Editors .. sepc .. " "
             if (string.sub(Editors,-1,-1) == sepc)
                then Editors = in_text .. Editors .. " "
                else Editors = in_text .. Editors .. sepc .. " "
            end
         end
         end
         text = Authors .. Coauthors .. " "..Date .. Chapter .. Editors .. tcommon .. Page .. Pages .. At .. idcommon
         text = Authors .. Coauthors .. " "..Date .. Chapter .. Editors .. tcommon .. Page .. Pages .. At .. idcommon
Line 1,131: Line 1,143:
--23Feb2013 Changed to omit dot in "et al." when sepc is "." separator.
--23Feb2013 Changed to omit dot in "et al." when sepc is "." separator.
--23Feb2013 Fixed "author1-first" to also get args.given or args.given1.
--23Feb2013 Fixed "author1-first" to also get args.given or args.given1.
--23Feb2013 Fixed args.article to set Title, after Periodical is Title.
--23Feb2013 Fixed to allow blank Title (such as "contribution=mytitle").
--23Feb2013 Fixed double-dot ".." at end of Editors list
--
--
--End
--End
Anonymous user