When "Arrange cards" is on in the view bar: drag the header to move the card.
<article aria-labelledby=...>
A card is made with htm_Card_() and closed with htm_Card_end(). Everything in between is the content.
With form: the card is also a form, and htm_Card_end(subm:true) adds the save button.
htm_Card_(capt:'@My card', icon:'fas fa-star', clas:'cardW320'); htm_TextDiv(body:'@The content of the card.'); htm_Card_end();
htm_Card_(capt:'@Contact', icon:'fas fa-user', form:'contact', clas:'cardW400'); htm_Input(labl:'@Name', name:'name', valu:$_POST['name'] ?? '', wdth:'90%'); htm_Input(labl:'@Email', name:'mail', valu:$_POST['mail'] ?? '', vrnt:'mail', wdth:'90%'); htm_Card_end(labl:'@Save', icon:'fas fa-floppy-disk', subm:true, foot:'@Remember to save');
htm_Card_(capt:'@Simple', simp:true, clas:'cardW240'); # Only the centered caption htm_TextDiv(body:'simp: true'); htm_Card_end(); htm_Card_(capt:'@Colors', icon:'fas fa-palette', clas:'cardW240', head:'background-color:#1565c0;', fclr:'color:white;'); # Header style and icon color htm_TextDiv(body:'head, fclr'); htm_Card_end(); htm_Card_(capt:'@Left and right', clas:'cardW240', frst:'<small>frst</small>', last:'<small>last</small>'); # last replaces the buttons htm_TextDiv(body:'frst, last'); htm_Card_end(); htm_Card_(capt:'@Help', icon:'fas fa-life-ring', clas:'cardW240', mode:'1', help:'documentation.page.php', hint:'@Your own hint on the caption'); # ? icon, only the height button htm_TextDiv(body:'help, mode:1, hint'); htm_Card_end(); htm_Card_(capt:'@No buttons', clas:'cardW240', show:false, hint:'', poup:false); # No buttons, no hint, no right-click menu htm_TextDiv(body:'show:false, hint:'', poup:false'); htm_Card_end();
htm_Card_(capt:'@Starts folded', icon:'fas fa-folder', clas:'cardW400', fold:'closed', wdth:'200px'); # Folded: 200px wide - open: 400px htm_TextDiv(body:'fold: closed, wdth: 200px'); htm_Card_end(); htm_Card_(capt:'@Scrolling body', icon:'fas fa-scroll', clas:'cardW280', vhgh:'110px', styl:'background-color: #fffbe6;', attr:'border: 2px solid #e0a800; border-radius: 8px;'); htm_TextDiv(body: str_repeat(lang('@More content than the height (vhgh) - it scrolls.').'<br>', 6), attr:'white-space: normal;'); htm_Card_end();
htm_Card_(capt:'@Outer card (with a form)', icon:'fas fa-box-open', form:'outer', clas:'cardW560'); htm_Input(labl:'@Outer field', name:'outer_f', valu:$_POST['outer_f'] ?? '', wdth:'90%'); htm_Card_(capt:'@Inner card', icon:'fas fa-box', form:'inner', clas:'cardW480', poup:false); # form: ignored (no nested forms) htm_Input(labl:'@Inner field', name:'inner_f', valu:$_POST['inner_f'] ?? '', wdth:'90%'); htm_Card_end(); htm_Card_end(labl:'@Save', subm:true);
htm_Card_(capt:'@News', icon:'fas fa-newspaper', clas:'cardW320', elem:'article'); htm_TextDiv(body:'<article aria-labelledby=...>'); htm_Card_end();
Parameter | Default | Type | Description |
|---|---|---|---|
| capt | '' | string | The card caption |
| icon | '' | string | Class: icon to the left of caption |
| hint | 'tgl' | string | The hint on the caption ('tgl': "click to open / close this card", '': none) |
| mode | '2' | string | The buttons: '0' none / '1' toggle the height / '2' also: toggle the width, close all, open all |
| form | '' | string | The name (and id) of a form around the card body - '' no form. Not inside a card that has a form (no nested forms) |
| acti | '' | string | The action of the form ('' this page). The form is POST, multipart, with the CSRF token cardW960, cardW800, cardW720, cardW640, cardW560, cardW480, cardW400, cardW320, cardW280, cardW240, cardW160 |
| wdth | '' | string | The width of the folded card (a number is px), e.g. '240px' - '' the same width |
| vhgh | '600px' | string | The max height of the body - more content scrolls ('none': no limit) |
| fclr | '' | string | Extra style of the header icons and text, e.g. 'color:snow;' |
| styl | 'background-color: white;' | string | Style of the card body |
| attr | 'margin-bottom: 8px;' | string | Style of the card itself (the outer element) |
| clas | 'cardWmax' | string | The width class: cardWmax (full), cardWaut (the content), cardW120 (1200px), cardW110, cardW100, |
| show | true | bool | Show the buttons at the right in the header |
| poup | true | bool | Right-click the header: a menu for all cards (heights, close / open all, original order) |
| head | 'background-color: white;' | string | Style of the header |
| help | '' | string | A link: a ? icon in the header opens it in a new window |
| frst | '' | string | HTML at the left in the header (the caption is then centered) |
| last | '' | string | HTML at the right in the header - it replaces the buttons (show/mode) |
| simp | false | bool | A simple header: only the centered caption (no buttons, no frst/last) |
| fold | '' | string | 'closed': the card starts folded (click the caption to open it) |
| elem | 'span' | string | The HTML element of the card: span (default) / section / article / aside / main / header / footer / div A semantic element (section...) gets the caption as its accessible name (aria-labelledby) |
| move | true | bool | The card can be moved among its sibling cards (how: $gbl_CardMove) - false: it stays in place |
| rtrn | false | bool | Return the HTML instead of echoing it |
Parameter | Default | Type | Description |
|---|---|---|---|
| labl | '' | string | The label of the submit button in the footer |
| icon | '' | string | An icon left of the label |
| hint | '' | string | The hint of the button ('' a reminder to save) |
| kind | 'save' | string | The color of the button: save, navi, goon, eras, crea, home, get_, put_, spc1, spc2 |
| name | '' | string | (Only a comment after </form>) |
| form | '' | string | The form to submit - in a card with its own form: always that form |
| attr | '' | string | Attributes of the button |
| subm | false | bool | A submit button in the footer - only in a card with its own form (form: in htm_Card_) |
| akey | '' | string | Access key of the button (Alt+key) |
| simu | false | bool | (Not used) |
| foot | '' | string | Footer text (HTML, translated) - the footer stays below the scrolling body and is hidden with it when the card is folded |
| rtrn | false | bool | Return the HTML instead of echoing it |