Template:Muwatta: Difference between revisions
[checked revision] | [checked revision] |
Lightyears (talk | contribs) (Changed template for Quranx.com) |
Lightyears (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
{{#vardefine:Clean4thParameter|}} | {{#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 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|}}} | | {{#if: {{{4|}}} | | ||
{{#ifexpr: {{#pos:0123456789|{{#sub:{{{4|}}}|0|1}}}} | {{#vardefine:Clean4thParameter|{{#sub:{{{4|}}}|0|1}}}} | {{#ifexpr: {{#pos:0123456789|{{#sub:{{{4|}}}|0|1}}}} | {{#vardefine:Clean4thParameter|{{#sub:{{{4|}}}|0|1}}}} | ||
Line 13: | Line 11: | ||
}} | }} | ||
}} | }} | ||
<!--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 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: {{{5|}}} | | ||
{{ #switch: {{lc: {{{5|}}} }} | {{ #switch: {{lc: {{{5|}}} }} | ||
Line 22: | Line 18: | ||
}}| | }}| | ||
{{#ifexpr: {{#var:Clean4thParameter}} | [http://quranx.com/Hadith/Malik/ByIndex/USC-MSA/Book-{{#expr:{{{2|1}}}}}/Hadith-{{#expr:{{#var:Clean4thParameter}}}}/ Al-Muwatta {{{2|1}}}:{{{4|1}}}] | [http://quranx.com/Hadith/Malik/ByIndex/USC-MSA/Book-{{#expr:{{{1|1}}}}}/Hadith-{{#expr:{{{3|1}}}}}/ Al-Muwatta {{{1|1}}}:{{{3|1}}}] | {{#ifexpr: {{#var:Clean4thParameter}} | [http://quranx.com/Hadith/Malik/ByIndex/USC-MSA/Book-{{#expr:{{{2|1}}}}}/Hadith-{{#expr:{{#var:Clean4thParameter}}}}/ Al-Muwatta {{{2|1}}}:{{{4|1}}}] | [http://quranx.com/Hadith/Malik/ByIndex/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 <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)--> | ||
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. | 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. |
Revision as of 20:43, 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: