Template:Bukhari: Difference between revisions

Expr function should not be used for DarusSalam refs which sometimes have suffixes for this collection. It was never actually even needed for the USC refs as the Three digit template added leading zeros as needed for the old cmje links but the edit source never had them (as the template would then add too many)
[checked revision][checked revision]
(Updated for new Quranx features)
(Expr function should not be used for DarusSalam refs which sometimes have suffixes for this collection. It was never actually even needed for the USC refs as the Three digit template added leading zeros as needed for the old cmje links but the edit source never had them (as the template would then add too many))
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{#if: {{{4|}}}  |  
{{#if: {{{4|}}}  |  
   {{ #switch: {{lc: {{{4|}}} }}  
   {{ #switch: {{lc: {{{4|}}} }}  
     | in-book = [http://quranx.com/Hadith/Bukhari/ByIndex/In-Book/Book-{{#expr:{{{2|1}}}}}/Hadith-{{#expr:{{{3|1}}}}}/ Sahih Bukhari {{{2|1}}}:{{{3|1}}} (In-Book Ref)]
     | in-book = [https://quranx.com/Hadith/Bukhari/In-Book/Book-{{{2|1}}}/Hadith-{{{3|1}}}/ Sahih Bukhari {{{2|1}}}:{{{3|1}}} (In-Book Ref)]
     | reference = [http://quranx.com/Hadith/Bukhari/ByIndex/Reference/Hadith-{{#expr:{{{3|1}}}}}/ Sahih Bukhari {{{3|1}}} (Dar-us-Salam Ref)]
     | darussalam= [https://quranx.com/Hadith/Bukhari/DarusSalam/Hadith-{{{3|1}}}/ Sahih Bukhari {{{3|1}}} (Dar-us-Salam Ref)]
     | [http://quranx.com/Hadith/Bukhari/ByIndex/In-Book/Book-{{#expr:{{{2|1}}}}}/Hadith-{{#expr:{{{3|1}}}}}/ Sahih Bukhari {{{2|1}}}:{{{3|1}}} (4th parameter error)]
     | [https://quranx.com/Hadith/Bukhari/DarusSalam/Hadith-{{{3|1}}}/ Sahih Bukhari {{{3|1}}} (4th parameter error)]
   }}|
   }}|
   [http://quranx.com/Hadith/Bukhari/ByIndex/USC-MSA/Volume-{{#expr:{{{1|1}}}}}/Book-{{#expr:{{{2|1}}}}}/Hadith-{{#expr:{{{3|1}}}}}/ Sahih Bukhari {{{1|1}}}:{{{2|1}}}:{{{3|1}}}]
   [https://quranx.com/Hadith/Bukhari/USC-MSA/Volume-{{{1|1}}}/Book-{{{2|1}}}/Hadith-{{{3|1}}}/ Sahih Bukhari {{{1|1}}}:{{{2|1}}}:{{{3|1}}}]
}}<noinclude>
}}<noinclude>
<!--The noinclude tag must be right at the end of the template on the same line or you will get new lines after its use in some situations-->
<!--The noinclude tag must be right at the end of the template on the same line or you will get new lines after its use in some situations-->
<!--The <nowiki>{{#expr: }}</nowiki> function in the template is used to trim any leading zeros in the numbers.-->
 
<!--the old cmje links were constructed making use of the <nowiki>{{three digit|}}</nowiki> function)-->
<templatedata>
{
"description": "This template will create a link to the specified hadith in Sahih Bukhari. Please visit its template page or read the Citing Sources page for instructions on its use with alternative hadith reference systems.",
"params": {
"1": {
"label": "Volume number",
"description": "The Volume number when using the USC-MSA reference system",
"required": false,
"suggested": true,
"type": "number",
"default": "1",
"example": "3"
},
"2": {
"label": "Book number",
"description": "The Book number when using the USC-MSA or In-book reference system",
"required": false,
"suggested": true,
"type": "number",
"default": "1",
"example": "27"
},
"3": {
"label": "Hadith number",
"description": "The hadith number",
"required": true,
"type": "number",
"default": "1",
"example": "8"
},
"4": {
"label": "Alternative reference system",
"description": "Enter darussalam when you are using the Dar-us-Salam reference system or in-book when using the In-book reference system (leave blank if using the USC-MSA reference system)",
"required": false,
"suggested": true,
"type": "string",
"default": "",
"example": "darussalam"
}
}
}
</templatedata>


This template is used to provide sources for Bukhari references from USC-MSA and other indexing conventions. It formerly produced links to the cmje website, which no longer works. We are currently using QuranX.com instead, which is able to handle USC-MSA, In-book, and Dar-us-Salam reference conventions.
This template is used to provide sources for Bukhari references from USC-MSA and other indexing conventions. It formerly produced links to the cmje website, which no longer works. We are currently using QuranX.com instead, which is able to handle USC-MSA, In-book, and Dar-us-Salam reference conventions.
Line 27: Line 68:
To cite a hadith with USC-MSA numbering:    <tt><nowiki>{{Bukhari|#|#|#}}</nowiki></tt>
To cite a hadith with USC-MSA numbering:    <tt><nowiki>{{Bukhari|#|#|#}}</nowiki></tt>


To cite a hadith with Dar-us-Salam Reference numbering:    <tt><nowiki>{{Bukhari|||#|reference}}</nowiki></tt> (note the empty first and second parameters)
To cite a hadith with Dar-us-Salam Reference numbering:    <tt><nowiki>{{Bukhari|||#|darussalam}}</nowiki></tt> (note the empty first and second parameters)


To cite a hadith with In-book numbering:    <tt><nowiki>{{Bukhari||#|#|in-book}}</nowiki></tt> (note the empty first parameter)
To cite a hadith with In-book numbering:    <tt><nowiki>{{Bukhari||#|#|in-book}}</nowiki></tt> (note the empty first parameter)
Line 38: Line 79:


;Example for the same hadith using Dar-us-Salam Reference numbering:
;Example for the same hadith using Dar-us-Salam Reference numbering:
:<nowiki>{{Bukhari|||1780|reference}}</nowiki>
:<nowiki>{{Bukhari|||1780|darussalam}}</nowiki>


Produces:
Produces:
:{{Bukhari|||1780|reference}}
:{{Bukhari|||1780|darussalam}}


;Example for the same hadith using In-book reference numbering:
;Example for the same hadith using In-book reference numbering:
Editors, em-bypass-2, Reviewers, rollback, Administrators
2,899

edits