Template:Muwatta: Difference between revisions
[checked revision] | [checked revision] |
Lightyears (talk | contribs) No edit summary |
Lightyears (talk | contribs) No edit summary |
||
Line 10: | Line 10: | ||
{{#ifexpr: {{#pos:0123456789|{{#sub:{{{4|}}}|3|1}}|}} | {{#vardefine:Clean4thParameter|{{#sub:{{{4|}}}|0|4}}}} | {{#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 url with 1st and 3rd parameters. If no 5th parameter, create a USC ref 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|}}} | | ||
<!--If parameter 5 exists and is not erroneously mistyped create an in-book url with 1st and 3rd parameters. If no 5th parameter, create a USC ref 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|}}} }} | {{ #switch: {{lc: {{{5|}}} }} | ||
| in-book = [http://quranx.com/Hadith/Malik/ByIndex/In-Book/Book-{{#expr:{{{1|1}}}}}/Hadith-{{#expr:{{{3|1}}}}}/ Al-Muwatta {{{1|1}}}:{{{3|1}}} (In-Book Ref)] | | in-book = [http://quranx.com/Hadith/Malik/ByIndex/In-Book/Book-{{#expr:{{{1|1}}}}}/Hadith-{{#expr:{{{3|1}}}}}/ Al-Muwatta {{{1|1}}}:{{{3|1}}} (In-Book Ref)] | ||
Line 20: | Line 18: | ||
}} | }} | ||
}}<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 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 <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)--> | <!--the old cmje links were constructed making use of the <nowiki>{{three digit|}}</nowiki> function)--> |
Revision as of 20:51, 3 January 2017
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 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 Verse 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)
- Example for hadiths using MSA-USC numbering
- {{Muwatta|14||8}} (note the empty 3rd parameter)
Produces:
- Example for the same hadith using in-book numbering
- {{Muwatta|14||465||in-book}} (note the empty 2nd and 4th parameters)
Produces: