Template:Muwatta: Difference between revisions

no edit summary
[checked revision][checked revision]
(Changed template for Quranx.com)
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)-->
<noinclude>
This template is used to provide sources for Sahih Muslim 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.
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.
Editors, em-bypass-2, Reviewers, rollback, Administrators
2,743

edits