Project

General

Profile

Actions

GUI standard » History » Revision 1

Revision 1/6 | Next »
Max Milbers, 02/25/2011 04:50 PM


GUI standard

Here follows a list of best practices when working develop a virtuemart view.

Using javascript

Administrators should have js enabled. We can expect that administrators have js enabled. Therefore the backend can have features that only reachable with js.

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.

Use of of JText and hardcoded formats and simular

echo JText::_('VM_FILES_LIST_THUMBNAIL_IMG').": ";
This is very bad and mustn't done. The ":" is hardcoded in the code. The right solution here is to write

echo JText::_('VM_FILES_LIST_THUMBNAIL_IMG');
and to add the colon to the language file.

Clicking cancel

When the user clicks cancel, the user is taken back from the editing screen to the page listing. No cancellation message will be shown.

Delete button on row

The page listings should not contain a delete button per row. A single delete button needs to be placed in the toolbar.

Database ID numbers

The page listings should not contain a database ID number.

Sortable columns

A column should, where possible be made sortable by clicking on the column header.

List order fields

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.

Some coding standards

Standard publishing fields use:

- published with 0 and 1 formatted in the db as tinyInt(1) with standard 0
- publish_up and publish_down formatted in the db as datetime with standard 0000-00-00 00:00:00

The standard query is then

@ $db = &JFactory::getDBO();
$this->_nullDate = $db->getNullDate();
$this->_now = JFactory::getDate()->toMySQL();
$query  = 'SELECT * FROM `#__sometable` WHERE yourexampel ="myexampelvalue" AND ';
$query .= ' ( publish_up = '.$this->_db->Quote($this->_nullDate).' OR publish_up <= '.$this->_db->Quote($this->_now).' )' .
' AND ( publish_down = '.$this->_db->Quote($this->_nullDate).' OR publish_down >= '.$this->_db->Quote($this->_now).' ) '; @

Updated by Max Milbers over 13 years ago · 1 revisions