Template:Muwatta: Difference between revisions

no edit summary
[checked revision][checked revision]
No edit summary
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)-->
Editors, em-bypass-2, Reviewers, rollback, Administrators
2,743

edits