Project

General

Profile

GUI standard » History » Version 6

Max Milbers, 02/18/2014 01:04 PM

1 1 Max Milbers
h1. GUI standard
2
3
Here follows a list of best practices when working develop a virtuemart view.
4
5
h2. Using javascript
6
7
Administrators should have js enabled. We can expect that administrators have js enabled. Therefore the backend can have features that only reachable with js.
8
9
But the shoppers are sometimes afraid to use js and dont trust a shop that is only working with js. So the whole frontend should be workable without js. This does not mean that every feature for comfort must be accessible without js, but the base functions.
10
11
h2. Use of of JText and hardcoded formats and simular
12
13 6 Max Milbers
Since joomla 3 the base JText::_ function is overloaded with an internal vsprint. Therefore we derivated our own JText => vmText. To stay compatible with VirtueMart 2.5 and VirtueMart 3, use vmText.
14
 
15
@echo vmText::_('VM_FILES_LIST_THUMBNAIL_IMG').": ";@
16 1 Max Milbers
This is very bad and mustn't done. The ":" is hardcoded in the code. The right solution here is to write
17
18 6 Max Milbers
@echo vmText::_('VM_FILES_LIST_THUMBNAIL_IMG');@
19 5 Max Milbers
and to add the colon and space to the language file.
20
21
h2. Reference to functions in explanations
22
23
Use in explanation always the sprintf function to use the real label of the button and do not use some meta expression for it. For an exampel look on the view updatesmigration (Tools & Migration) in BE.
24
@echo JText::sprintf('COM_VIRTUEMART_SYSTEM_DANGEROUS_TOOL_ENABLED',JText::_('COM_VIRTUEMART_ADMIN_CFG_DANGEROUS_TOOLS'),$link)@
25
Before we had a text like "Please enable the dangerous tools in the config". But the option is named "Enable database Update tools". The new text shows "To use these tools fully, you must check 'Enable database Update tools' in the Configuration panel." There is additionally a link added directly to the option, this is also a prefered behaviour.
26 1 Max Milbers
27
h2. Clicking cancel
28
29
When the user clicks cancel, the user is taken back from the editing screen to the page listing. No cancellation message will be shown.
30
31
h2. Delete button on row
32
33
The page listings should not contain a delete button per row. A single delete button needs to be placed in the toolbar.
34
35
h2. Database ID numbers
36
37
The page listings should not contain a database ID number.
38
39
h2. Sortable columns
40
41
A column should, where possible be made sortable by clicking on the column header.
42
43
h2. List order fields
44
45
A list order field should for new entries be disabled and shown the text string containing: "New items default to the last place. Ordering can be changed after this item is saved." For existing entries, the List order dropdown will be shown, this will allow the user to choose where to place the item.
46 3 Max Milbers
47
h2. Hiding of layouts for the joomla view chooser
48 4 Max Milbers
49 3 Max Milbers
It is important that there is always the default layout visible in the chooser. In other case layouts used for overrides, makes it impossible to choose the default layout.