Template:Muwatta: Difference between revisions

From WikiIslam, the online resource on Islam
Jump to navigation Jump to search
[checked revision][checked revision]
No edit summary
No edit summary
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Compendium of Muslim Texts|Al-Muwatta]] [{{Compendium-of-muslim-texts-base-url}}/hadith/muwatta/{{three digit|{{{1|7}}}}}-mmt.php#{{three digit|{{{1|7}}}}}.{{{1|7}}}.{{{2|1}}}.{{{3|5}}}{{{4|b}}} {{{1|7}}} {{{2|1}}}.{{{3|5}}}{{{4|b}}}]<noinclude>
{{#vardefine:Clean4thParameter|}}
<!--If parameter 4 exists, set the variable to the number at the start of it (1-4 digits) if there is one due to misuse by some editors. Leaves out any suffix-->
{{#if: {{{4|}}}  |
  {{#ifexpr: {{#pos:0123456789|{{#sub:{{{4|}}}|0|1}}}}    |  {{#vardefine:Clean4thParameter|{{#sub:{{{4|}}}|0|1}}}}
  }}
  {{#ifexpr: {{#pos:0123456789|{{#sub:{{{4|}}}|1|1}}}}    |  {{#vardefine:Clean4thParameter|{{#sub:{{{4|}}}|0|2}}}}
  }}
  {{#ifexpr: {{#pos:0123456789|{{#sub:{{{4|}}}|2|1}}}}    |  {{#vardefine:Clean4thParameter|{{#sub:{{{4|}}}|0|3}}}}
  }}
  {{#ifexpr: {{#pos:0123456789|{{#sub:{{{4|}}}|3|1}}|}}  | {{#vardefine:Clean4thParameter|{{#sub:{{{4|}}}|0|4}}}}
  }}
}}<!--If parameter 5 exists and is not erroneously mistyped, create an In-book reference url with 1st and 3rd parameters. If no 5th parameter, create a USC-MSA ref url, using parameters 2 and 4 for cases where the old template was misused (i.e. 4 contains a number), or otherwise with parameters 1 and 3-->{{#if: {{{5|}}}  |
  {{ #switch: {{lc: {{{5|}}} }}  
    | arabic = [https://quranx.com/Hadith/Malik/In-Book/Book-{{#expr:{{{1|1}}}}}/Hadith-{{#expr:{{{3|1}}}}}/ Al-Muwatta {{{1|1}}}:{{{3|1}}} (Arabic Ref)]
    | [https://quranx.com/Hadith/Malik/In-Book/Book-{{#expr:{{{1|1}}}}}/Hadith-{{#expr:{{{3|1}}}}}/ Al-Muwatta {{{1|1}}}:{{{3|1}}} (5th parameter error)]
  }}|
    {{#ifexpr: {{#var:Clean4thParameter}}  |  [https://quranx.com/Hadith/Malik/USC-MSA/Book-{{#expr:{{{2|1}}}}}/Hadith-{{#expr:{{#var:Clean4thParameter}}}}/ Al-Muwatta {{{2|1}}}:{{{4|1}}}]  |  [https://quranx.com/Hadith/Malik/USC-MSA/Book-{{#expr:{{{1|1}}}}}/Hadith-{{#expr:{{{3|1}}}}}/ Al-Muwatta {{{1|1}}}:{{{3|1}}}]  
    }} 
}}<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 final and first brackets of the two if statements must be on the same line (ignoring comments) to avoid sometimes getting new lines before the template.-->
<!--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 Muwatta Malik. Please visit its template page or read the Citing Sources page for instructions on its use with alternative hadith reference systems.",
"params": {
"1": {
"label": "Book number",
"description": "The Book number when using the USC-MSA or Arabic reference system",
"required": true,
"type": "number",
"default": "1",
"example": "27"
},
"2": {
"label": "Section number",
"description": "The Section number when using the USC-MSA reference system (can be left blank)",
"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": "Suffix",
"description": "Any suffix letter after the hadith number (can be left blank)",
"required": false,
"suggested": true,
"type": "string",
"default": "",
"example": "a"
},
"5": {
"label": "Alternative reference system",
"description": "Enter arabic when you are using the Arabic reference system (leave blank if using the USC-MSA reference system)",
"required": false,
"suggested": true,
"type": "string",
"default": "",
"example": "arabic"
}
}
}
</templatedata>
 
This template is used to provide sources for al-Muwatta references. 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, and in-book (Arabic) reference conventions.


This template is used to provide sources for Muwatta references from USC-MSA.


==Usage==
==Usage==
First Parameter is the Book Number.<BR>
First Parameter is the Book Number.<BR>
Second Parameter is the Section Number.<BR>
Second Parameter is the Section Number (leave this empty - it is ignored by the current template and was used for the cmje site)<BR>
Thrid Parameter is the Verse Number.<BR>
Third Parameter is the Hadith Number.<BR>
Forth Parameter is for the a, b, c etc suffix which some hadiths have on cmje (leave this empty - it is ignored by the current template except for any number within it due to some editors incorrectly using the template in the past by putting the hadith number in there (with or without suffix) and the book number in the 2nd parameter)
 
Fifth Paramater (optional) is used to indicate that you are using the Arabic reference system (default is USC-MSA).
;Example for hadiths using MSA-USC numbering:
:<nowiki>{{Muwatta|14||8}}</nowiki> (note the empty 2nd parameter)
 
Produces:
:{{Muwatta|14||8}}


;Source and sample
;Example for the same hadith using Arabic reference numbering:
{{clear}}
:<nowiki>{{Muwatta|14||465||arabic}}</nowiki> (note the empty 2nd and 4th parameters)
'''For hadiths with section "a","b" and so on use'''
*<nowiki>{{Muwatta|7|1|5|b}}</nowiki> will produce {{Muwatta|7|1|5|b}}
'''For hadiths without sections use the following format'''
*<nowiki>{{Muwatta|17|19|34|}}</nowiki> will produce {{Muwatta|17|19|34|}}


Produces:
:{{Muwatta|14||465||arabic}}





Latest revision as of 01:43, 22 December 2018

Al-Muwatta 1:1

This template will create a link to the specified hadith in Muwatta Malik. Please visit its template page or read the Citing Sources page for instructions on its use with alternative hadith reference systems.

Template parameters

ParameterDescriptionTypeStatus
Book number1

The Book number when using the USC-MSA or Arabic reference system

Default
1
Example
27
Numberrequired
Section number2

The Section number when using the USC-MSA reference system (can be left blank)

Default
1
Example
27
Numbersuggested
Hadith number3

The hadith number

Default
1
Example
8
Numberrequired
Suffix4

Any suffix letter after the hadith number (can be left blank)

Default
Example
a
Stringsuggested
Alternative reference system5

Enter arabic when you are using the Arabic reference system (leave blank if using the USC-MSA reference system)

Default
Example
arabic
Stringsuggested

This template is used to provide sources for al-Muwatta references. 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, and in-book (Arabic) reference conventions.


Usage

First Parameter is the Book Number.
Second Parameter is the Section Number (leave this empty - it is ignored by the current template and was used for the cmje site)
Third Parameter is the Hadith Number.
Forth Parameter is for the a, b, c etc suffix which some hadiths have on cmje (leave this empty - it is ignored by the current template except for any number within it due to some editors incorrectly using the template in the past by putting the hadith number in there (with or without suffix) and the book number in the 2nd parameter)

Fifth Paramater (optional) is used to indicate that you are using the Arabic reference system (default is USC-MSA).

Example for hadiths using MSA-USC numbering
{{Muwatta|14||8}} (note the empty 2nd parameter)

Produces:

Al-Muwatta 14:8

Example for the same hadith using Arabic reference numbering
{{Muwatta|14||465||arabic}} (note the empty 2nd and 4th parameters)

Produces:

Al-Muwatta 14:465 (Arabic Ref)