Styleguide: Difference between revisions
m Socialmedia template no longer needed |
|||
(52 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
'''Note: some of this documentation needs to be updated''' |
|||
==Introduction== |
==Introduction== |
||
In order to get an better picture of how the templates on donate.wiki relate to one another review the images below. The Landing Page is chopped up into many templates so that we can change and test individual pieces of the page without changing core functional pieces of the page. This provides us with more stability for a broader range of users. |
In order to get an better picture of how the templates on donate.wiki relate to one another review the images below. The Landing Page is chopped up into many templates so that we can change and test individual pieces of the page without changing core functional pieces of the page. This provides us with more stability for a broader range of users. |
||
Line 7: | Line 9: | ||
===Information flow=== |
===Information flow=== |
||
The flow of information from template to template is laid out in |
The flow of information from template to template is laid out in '''Fig. 2''' on the right. |
||
[[Image:LPtemplateflow.svg|frame|right|alt=Flow cart showing how information goes from banner to template to template generating a Landing Page.|'''Fig. 2:''' A flow cart showing how information goes from banner to template to template generating a Landing Page. Black boxes are the templates being used to generate the LP. The blue boxes are the perimeters that are required by the templates that they are below. Orange boxes are the perimeters set in order to make superficial changes.]] |
[[Image:LPtemplateflow.svg|frame|right|alt=Flow cart showing how information goes from banner to template to template generating a Landing Page.|'''Fig. 2:''' A flow cart showing how information goes from banner to template to template generating a Landing Page. Black boxes are the templates being used to generate the LP. The blue boxes are the perimeters that are required by the templates that they are below. Orange boxes are the perimeters set in order to make superficial changes.]] |
||
==Banner== |
==Banner== |
||
Banner settings completely determine which landing page is displayed, in which language, and where the page runs. All banners call the [[Lp-layout-default]] template and pass it the names of 4 templates. The default values follow: |
Banner settings completely determine which landing page is displayed, in which language, and where the page runs. All banners call the [[Template:Lp-layout-default]] template and pass it the names of 4 templates. The default values follow: |
||
*[[Template:2011FR/Appeal-template-default]] |
*[[Template:2011FR/Appeal-template-default]] |
||
*"Appeal-default" |
*"Appeal-default" |
||
Line 19: | Line 21: | ||
For specifics of the donate.wiki versions of the banner code visit [[Styleguide/Banner]]. |
For specifics of the donate.wiki versions of the banner code visit [[Styleguide/Banner]]. |
||
==Appeal== |
==Appeal Templates== |
||
The "2011FR/'''Appeal-default'''" is used by [[Template:2011FR/Appeal-template-default]] to call the following 2 templates: |
The "2011FR/'''Appeal-default'''" is used by [[Template:2011FR/Appeal-template-default]] to call the following 2 templates: |
||
*[[Template:2011FR/Appeal-default/text/en]] |
*[[Template:2011FR/Appeal-default/text/en]] |
||
*[[Template:2011FR/Appeal-default/title/en]] |
*[[Template:2011FR/Appeal-default/title/en]] |
||
==Donation Form Templates== |
|||
==Payment== |
|||
The template that ties together the payment form on the right of the page is [[Template:2011FR/Form-template-default]]. The country specific details are set by the template [[Template:2011FR/Form-countryspecific-control]]. |
The template that ties together the payment form on the right of the page is [[Template:2011FR/Form-template-default]]. The country specific details are set by the template [[Template:2011FR/Form-countryspecific-control]]. |
||
==Form-countryspecific-control example== |
|||
This is example code from [[Template:2011FR/Form-countryspecific-control/AU]]. |
This is example code from [[Template:2011FR/Form-countryspecific-control/AU]]. |
||
The following CSS is used to enable or disable payment methods for each country by commenting out either the "display: 'status';"(on) or the "display: none;"(off). |
|||
<pre> |
<pre> |
||
<html> |
<html> |
||
<style type="text/css"> |
|||
#CC-donate-button{ |
|||
display: </html>{{CC-status}}<html>; |
|||
/*display: none;*/ |
|||
} |
|||
#Ideal-donate-button{ |
|||
/*display: </html>{{RT-status}}<html>;*/ |
|||
display: none; |
|||
} |
|||
#eps-donate-button{ |
|||
/*display: </html>{{RT-status}}<html>;*/ |
|||
display: none; |
|||
} |
|||
#sofort-donate-button{ |
|||
/*display: </html>{{RT-status}}<html>;*/ |
|||
display: none; |
|||
} |
|||
#DD-donate-button{ |
|||
/*display: </html>{{DD-status}}<html>;*/ |
|||
display: none; |
|||
} |
|||
#PP-donate-button{ |
|||
display: </html>{{PP-status}}<html>; |
|||
/*display: none;*/ |
|||
} |
|||
#PP-USD-donate-button{ |
|||
/*display: </html>{{PP-status}}<html> !important;*/ |
|||
display: none; |
|||
} |
|||
#RPP-donate-button{ |
|||
/*display: </html>{{PP-status}}<html>;*/ |
|||
display: none; |
|||
} |
|||
#YD-donate-button{ |
|||
/*display: </html>{{YD-status}}<html>;*/ |
|||
display: none; |
|||
} |
|||
#MB-donate-button{ |
|||
/*display: </html>{{MB-status}}<html>;*/ |
|||
display: none; |
|||
} |
|||
#BP-donate-button{ |
|||
/*display: </html>{{BP-status}}<html>;*/ |
|||
display: none; |
|||
} |
|||
#BT-donate-button{ |
|||
display: </html>{{BT-status}}<html>; |
|||
/*display: none;*/ |
|||
} |
|||
#BP-donate-button{ |
|||
display: </html>{{Bpay-status}}<html>; |
|||
/*display: none;*/ |
|||
} |
|||
</style> |
|||
</html> |
</html> |
||
{{2012FR/Form-section/Processing/Default |
|||
</pre> |
|||
| language = {{{language}}} |
|||
This part of the code pulls in the payment processing JS. Most of the perimeter are used to past information around. The only one that should be changed is "GC-CC-ffname". This perimeter changes the credit cards that we accept in that country. A list of options follows: |
|||
*cc-vm |
|||
*cc-vma |
|||
*cc-vmj |
|||
*cc-vmaj |
|||
<pre> |
|||
{{2011FR/Form-section-processing |
|||
| uselang = {{{uselang}}} |
|||
| country = {{{country}}} |
| country = {{{country}}} |
||
| appeal = {{{appeal}}} |
| appeal = {{{appeal}}} |
||
| currency = {{ |
| currency = {{2012FR/Switch/Currency/Code|{{{country}}}}} |
||
| handler = GC |
| handler = GC |
||
| GC-CC-ffname = cc-vmaj |
| GC-CC-ffname = cc-vmaj |
||
}} |
}} |
||
{{2012FR/Form-section/Radiobuttons/Default |
|||
</pre> |
|||
This part of the code pulls in the display method for the donation options and sets the values to be displayed. The "donate-amount-*" perimeters set the values that will be used in the country. These values are in the currency that has been set as the local currency. |
|||
<pre> |
|||
{{2011FR/Form-section-radiobuttons |
|||
| country = {{{country}}} |
| country = {{{country}}} |
||
| |
| language = {{{language}}} |
||
| currency = {{ |
| currency = {{2012FR/Switch/Currency/Code|{{{country}}}}} |
||
| donate-amount-0 = 5 |
| donate-amount-0 = 5 |
||
| donate-amount-1 = 10 |
| donate-amount-1 = 10 |
||
Line 120: | Line 54: | ||
| donate-amount-6 = 250 |
| donate-amount-6 = 250 |
||
}} |
}} |
||
{{2012FR/Form-section/Paymentmethods/Creditcard}} |
|||
{{2012FR/Form-section/Paymentmethods/EWallet/PayPal}} |
|||
{{2012FR/Form-section/Paymentmethods/OnlineBT/BPay}} |
|||
{{2012FR/Form-section/Paymentmethods/Banktransfer}} |
|||
<html> |
|||
</html> |
|||
</pre> |
</pre> |
||
== |
===Payment Processing=== |
||
[[Template:2012FR/Form-section/Processing/Default]] |
|||
This template pulls in the payment processing. |
|||
*[[Template:2011FR/core-currency-code]] |
|||
Currently, there are the following credit card combinations available: |
|||
*[[Template:2011FR/core-currency-symbol]] |
|||
*cc-vm - Visa, Master Card |
|||
*cc-vma - Visa, Master Card, JCB |
|||
*cc-vmj - Visa, Master Card, American Express |
|||
*cc-vmaj - Visa, Master Card, American Express, JCB |
|||
===Donation Amounts=== |
|||
*[[Template:2011FR/lp-social-media]] |
|||
[[Template:2012FR/Form-section/Radiobuttons/Default]] |
|||
This template pulls in the display method for the donation options and sets the values to be displayed. The "donate-amount-*" perimeters set the values that will be used in the country. These values are in the currency that has been set as the local currency. |
|||
===Payment Methods=== |
|||
There is a list of all the payment methods that can be added to a country at [[Template:2012FR/Form-section/Paymentmethods]]. |
|||
==Helper Templates== |
|||
===Currency templates=== |
|||
The following 2 templates contain the information needed to get currency details. |
|||
*[[Template:2012FR/Switch/Currency/Code]] - Returns the code of the official currency for each country. |
|||
*[[Template:2012FR/Switch/Currency/Symbol]] - Returns the symbol for each currency. |
|||
*[[Template:2012FR/Switch/Currency/Minimums]] - Lists the minimum donation amount for each currency to be used in a JavaScript array. |
|||
*[[Template:2012FR/Switch/Currency/Position]] - Returns "before" or "after" given a language, country and currency combination. This tells whether the symbol comes before or after the value when displaying a currency amount. |
|||
===Switch templates=== |
===Switch templates=== |
||
Line 134: | Line 90: | ||
*[[Template:AppealAmountSwitch]] |
*[[Template:AppealAmountSwitch]] |
||
*[[Template:AppealAmountSwitch/en]] |
*[[Template:AppealAmountSwitch/en]] |
||
*[[Template: |
*[[Template:2012FR/Switch/Appeal]] |
||
*[[Template: |
*[[Template:2012FR/Switch/Country]] |
||
*[[Template: |
*[[Template:2012FR/Switch/Infobox]] |
||
*[[Template:Ltr-direction]] |
*[[Template:2012FR/Switch/Ltr-direction]] |
||
*[[Template:2012FR/Switch/Translationlink]] |
|||
===Payment method templates=== |
|||
There is a list of all the payment methods that can be added to a country at [[Template:2012FR/Form-section/Paymentmethods]]. |
|||
===Misc. Templates=== |
|||
*[[Template:Numstaff]] - Controls the # we display for our staff count. |
|||
==F.A.Q.== |
|||
===How do I add currencies?=== |
|||
There are 4 templates that need to be changed to add a currency to be usable. |
|||
These three templates add all the needed details for each currency. |
|||
*[[Template:2012FR/Switch/Currency/Symbol]] - This template sets the symbol used with each currecny. |
|||
*[[Template:2012FR/Switch/Currency/Minimums]] - This template sets the minimum donation amount for each currency which is about 1 USD. |
|||
*[[Template:2012FR/Switch/Currency/Position]] - This template sets the position of the currency symbol relative to the value, before or after. |
|||
This template enables the currencies by linking them to countries |
|||
*[[Template:2012FR/Switch/Currency/Code]] - This template sets the default currency for each country. |
|||
===How do I add countries?=== |
|||
To add a country a minimum of 4 templates must be created. |
|||
First, make sure the currency the new country uses is enabled. See [[Styleguide#How do I add currencies?|How do I add currencies?]] |
|||
Second, the "Form-countryspecific-*" templates must be created |
|||
At least the following country specific templates must be created |
|||
*[[Template:2011FR/Form-countryspecific-control/XX]] |
|||
*[[Template:2011FR/Form-countryspecific-monthly/XX]] |
|||
*[[Template:2011FR/Form-countryspecific-recurring/XX]] |
|||
To do A/B/C/etc testing for this new country the "variable" page need to be created |
|||
*[[Template:2011FR/Form-countryspecific-variable1/XX]] |
|||
*[[Template:2011FR/Form-countryspecific-variable2/XX]] |
|||
*[[Template:2011FR/Form-countryspecific-variable3/XX]] |
|||
===How do I customize Landing Pages for a country?=== |
|||
To customize the donation forms for each country changes need to be made to the corresponding "Form-countryspecific-*" and "Form-template-*" templates. |
|||
===How do I add new payment methods?=== |
|||
To add new payment methods 1 template needs to be edited and 1 new template must be created. |
|||
The template that must be edited is [[Template:2012FR/Form-section/Processing/Default]] and a new "Form-section/Paymentmethod/*" template must be made. |
|||
===How do I enable or disable payment methods?=== |
|||
Each payment method has a master switch that can disable all processing of that type. The switch is located in the template [[Template:2012FR/Form-section/Paymentmethods/Status]]. By going to this template and changing the CSS property "display" to either "block" or "none", one can enable or disable payment methods respectively. |
|||
Enabling and disabling payment methods for individual countries can be done by adding and removing the payment method templates listed above from the "Form-countryspecific-*" template. |
|||
==Tools== |
|||
===Payment method status=== |
|||
===Scripts=== |
|||
The following is a list of templates that can be use to turn on and off their respective payment methods by toogling the value stored inside the template between "block"(on) and "none"(off). |
|||
[[Styleguide/Scripts]] |
|||
*[[Template:BP-status]] |
|||
*[[Template:BT-status]] |
|||
*[[Template:CC-status]] |
|||
*[[Template:DD-status]] |
|||
*[[Template:MB-status]] |
|||
*[[Template:PP-status]] |
|||
*[[Template:RT-status]] |
|||
*[[Template:YD-status]] |
Latest revision as of 13:35, 9 April 2024
Note: some of this documentation needs to be updated
Introduction
In order to get an better picture of how the templates on donate.wiki relate to one another review the images below. The Landing Page is chopped up into many templates so that we can change and test individual pieces of the page without changing core functional pieces of the page. This provides us with more stability for a broader range of users.
- Superficial changes to the various payment options can be done with editing the "Form-countryspecific-*" template for the country you wish to change.
- Superficial changes to the layout and the appeal are done by changing the banner.
Information flow
The flow of information from template to template is laid out in Fig. 2 on the right.
Banner
Banner settings completely determine which landing page is displayed, in which language, and where the page runs. All banners call the Template:Lp-layout-default template and pass it the names of 4 templates. The default values follow:
- Template:2011FR/Appeal-template-default
- "Appeal-default"
- Template:2011FR/Form-template-default
- Template:2011FR/Form-countryspecific-control
For specifics of the donate.wiki versions of the banner code visit Styleguide/Banner.
Appeal Templates
The "2011FR/Appeal-default" is used by Template:2011FR/Appeal-template-default to call the following 2 templates:
Donation Form Templates
The template that ties together the payment form on the right of the page is Template:2011FR/Form-template-default. The country specific details are set by the template Template:2011FR/Form-countryspecific-control.
Form-countryspecific-control example
This is example code from Template:2011FR/Form-countryspecific-control/AU.
<html> </html> {{2012FR/Form-section/Processing/Default | language = {{{language}}} | country = {{{country}}} | appeal = {{{appeal}}} | currency = {{2012FR/Switch/Currency/Code|{{{country}}}}} | handler = GC | GC-CC-ffname = cc-vmaj }} {{2012FR/Form-section/Radiobuttons/Default | country = {{{country}}} | language = {{{language}}} | currency = {{2012FR/Switch/Currency/Code|{{{country}}}}} | donate-amount-0 = 5 | donate-amount-1 = 10 | donate-amount-2 = 20 | donate-amount-3 = 25 | donate-amount-4 = 50 | donate-amount-5 = 100 | donate-amount-6 = 250 }} {{2012FR/Form-section/Paymentmethods/Creditcard}} {{2012FR/Form-section/Paymentmethods/EWallet/PayPal}} {{2012FR/Form-section/Paymentmethods/OnlineBT/BPay}} {{2012FR/Form-section/Paymentmethods/Banktransfer}} <html> </html>
Payment Processing
Template:2012FR/Form-section/Processing/Default This template pulls in the payment processing. Currently, there are the following credit card combinations available:
- cc-vm - Visa, Master Card
- cc-vma - Visa, Master Card, JCB
- cc-vmj - Visa, Master Card, American Express
- cc-vmaj - Visa, Master Card, American Express, JCB
Donation Amounts
Template:2012FR/Form-section/Radiobuttons/Default This template pulls in the display method for the donation options and sets the values to be displayed. The "donate-amount-*" perimeters set the values that will be used in the country. These values are in the currency that has been set as the local currency.
Payment Methods
There is a list of all the payment methods that can be added to a country at Template:2012FR/Form-section/Paymentmethods.
Helper Templates
Currency templates
The following 2 templates contain the information needed to get currency details.
- Template:2012FR/Switch/Currency/Code - Returns the code of the official currency for each country.
- Template:2012FR/Switch/Currency/Symbol - Returns the symbol for each currency.
- Template:2012FR/Switch/Currency/Minimums - Lists the minimum donation amount for each currency to be used in a JavaScript array.
- Template:2012FR/Switch/Currency/Position - Returns "before" or "after" given a language, country and currency combination. This tells whether the symbol comes before or after the value when displaying a currency amount.
Switch templates
The following is a list of templates templates that are used to change page content based on language, country, etc.
- Template:AppealAmountSwitch
- Template:AppealAmountSwitch/en
- Template:2012FR/Switch/Appeal
- Template:2012FR/Switch/Country
- Template:2012FR/Switch/Infobox
- Template:2012FR/Switch/Ltr-direction
- Template:2012FR/Switch/Translationlink
Payment method templates
There is a list of all the payment methods that can be added to a country at Template:2012FR/Form-section/Paymentmethods.
Misc. Templates
- Template:Numstaff - Controls the # we display for our staff count.
F.A.Q.
How do I add currencies?
There are 4 templates that need to be changed to add a currency to be usable.
These three templates add all the needed details for each currency.
- Template:2012FR/Switch/Currency/Symbol - This template sets the symbol used with each currecny.
- Template:2012FR/Switch/Currency/Minimums - This template sets the minimum donation amount for each currency which is about 1 USD.
- Template:2012FR/Switch/Currency/Position - This template sets the position of the currency symbol relative to the value, before or after.
This template enables the currencies by linking them to countries
- Template:2012FR/Switch/Currency/Code - This template sets the default currency for each country.
How do I add countries?
To add a country a minimum of 4 templates must be created. First, make sure the currency the new country uses is enabled. See How do I add currencies?
Second, the "Form-countryspecific-*" templates must be created At least the following country specific templates must be created
- Template:2011FR/Form-countryspecific-control/XX
- Template:2011FR/Form-countryspecific-monthly/XX
- Template:2011FR/Form-countryspecific-recurring/XX
To do A/B/C/etc testing for this new country the "variable" page need to be created
- Template:2011FR/Form-countryspecific-variable1/XX
- Template:2011FR/Form-countryspecific-variable2/XX
- Template:2011FR/Form-countryspecific-variable3/XX
How do I customize Landing Pages for a country?
To customize the donation forms for each country changes need to be made to the corresponding "Form-countryspecific-*" and "Form-template-*" templates.
How do I add new payment methods?
To add new payment methods 1 template needs to be edited and 1 new template must be created.
The template that must be edited is Template:2012FR/Form-section/Processing/Default and a new "Form-section/Paymentmethod/*" template must be made.
How do I enable or disable payment methods?
Each payment method has a master switch that can disable all processing of that type. The switch is located in the template Template:2012FR/Form-section/Paymentmethods/Status. By going to this template and changing the CSS property "display" to either "block" or "none", one can enable or disable payment methods respectively.
Enabling and disabling payment methods for individual countries can be done by adding and removing the payment method templates listed above from the "Form-countryspecific-*" template.