CodingGuideline.rst 2.7 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
.. ==================================================
.. ==================================================
.. ==================================================
.. Header hierarchy
.. ==
..  --
..   ^^
..    ""
..     ;;
..      ,,
..
.. --------------------------------------------used to the update the records specified ------
.. Best Practice T3 reST: https://docs.typo3.org/m/typo3/docs-how-to-document/master/en-us/WritingReST/CheatSheet.html
..             Reference: https://docs.typo3.org/m/typo3/docs-how-to-document/master/en-us/WritingReST/Index.html
.. Italic *italic*
.. Bold **bold**
.. Code ``text``
.. External Links: `Bootstrap <http://getbootstrap.com/>`_
19
.. Internal Link: :ref:`downloadButton` (default url text) or :ref:`download Button<downloadButton>` (explicit url text)
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.. Add Images:    .. image:: ../Images/a4.jpg
..
..
.. Admonitions
..           .. note::   .. important::     .. tip::     .. warning::
.. Color:   (blue)       (orange)           (green)      (red)
..
.. Definition:
.. some text becomes strong (only one line)
..      description has to indented

.. -*- coding: utf-8 -*- with BOM.

.. include:: Includes.txt


.. _`CodingGuideline`:

Coding Guideline
================

The following is not mandatory but shows some best practices:

Constants
---------

* Define constants in ``Extensions > QFQ > Custom > ...``

* Dynamic values under ``Extensions > QFQ > Dynamic > ...``


QFQ content record
------------------

* Name the record in the header field with:

  * Regular content: ``[QFQ] ...``
  * Content in the left column: ``[QFQ,L] ...``
  * Content in englisch: ``[QFQ,E] ...``

Carsten  Rose's avatar
Carsten Rose committed
60
61
* The first lines should be comments, explaining what the record does and list all passed variables. Optional variables
  are indicated by using STORE_EMPTY or STORE_ZERO::
62
63
64
65
66
67
68

    #
    # Shows list of Persons living in {{country:SE}}
    #
    # {{country:SE}}
    #

Carsten  Rose's avatar
Carsten Rose committed
69
* A good practice is to define all possible STORE_SIP Parameter in a SQL at the beginning and copy them to STORE_RECORD::
70

Carsten  Rose's avatar
Carsten Rose committed
71
72
73
      10 {
        # Normalize variables
        sql = SELECT '{{country:SE}}' AS _country
74

Carsten  Rose's avatar
Carsten Rose committed
75
        # List selected persons per country
Carsten  Rose's avatar
Carsten Rose committed
76
77
        20.sql = SELECT p.name FROM Person AS p WHERE p.country LIKE '{{country:R}}'
      }
78
79

* Always comment the queries like shown above.
80
81
82
83

QFQ Form
--------

84
* Mandatory SIP parameter should to be mentioned in Form.requiredNew and/or Form.requiredEdit.
85
86
87
* If the title of a FormElement isn't descriptive enough, use tooltip, note or extraButtonInfo to explain to a user.
* Every Form should show a descriptive title to identify the task and current record. E.g. Not 'Person' but 'Person: John Doe'.
* Often the length of a pill title if not sufficient, use a tooltip to give a more descriptive hint.