correct format of multiline code-blocks

Ralf Becker 2024-04-18 08:09:24 +02:00
parent b149022aa6
commit 346ccfe5da

@ -53,18 +53,22 @@ After changing permissions you need to clear cache (Admin -> clear cache" as per
**2. Details of custom fields and options**
* Custom fields of type label or header are spanning all columns, while "regular custom fields" are displaying in 2 columns with label and value. If custom fields are having long labels and you want to change the width of the label column, this can be done by css in the etemplate using "styles" e.g.
`<styles>`
`table.et2_customfield_list tr td:first-child {`
`width: 30%;`
`overflow-x:hidden;`
`text-overflow:ellipsis;`
`}`
`</styles>`
* Custom fields of type "selectbox" (or Radio button) can specify the values in options (splitted by new line) e.g.
`=select one'
'english=english | Englisch'
'french=french | Französich'
'german=german | Deutsch`
```
<styles>
table.et2_customfield_list tr td:first-child {
width: 30%;
overflow-x:hidden;
text-overflow:ellipsis;
}
</styles>
```
* Custom fields of type "selectbox" (or Radio button) can specify the values in options (splited by new line) e.g.
```
=select one
english=english | Englisch
french=french | Französisch
german=german | Deutsch
```
The part before "=" specifies the value stored in the database, while the label behind "=" is what gets displayed to the user.
We recommend to avoid space and umlaute for the value and don't change it. Label can be adapted at any time as well as adding new values to the select box options.
* Admin can specify multiple rows (for text fields or select boxes),to get a textbox with X rows or a multi-selection.
@ -79,25 +83,28 @@ With option "maxlength=2000" the allowed text length can be specified, so user c
* **IN EGroupware EPL version Admin can mount eTemplates-Directory into filemanager** in Admin -> Applications -> Filemanager -> VFS mounts and versioning by simply clicking on the button:
![Admin - Applications - Filemanager - VFS mounts and versioning](https://www.egroupware.org/wp-content/uploads/Mount-etemplates.png)
* **In filemanager there is now directly the directory "/etemplates"** with subdirectories of the applications e.g. "addressbook" or "infolog". In the app-directory is another subdirectory called "templates" with two other subs "default" and "mobile".
* If you check for example /etemplates/addressbook/templates/default you see files like "edit.xet", "display.xet" and "index.xet". "display.xet" is used in CRM-view, so if you want to show there additional information of an organisation e.g. a custmer-number this can be added there. "index.xet" is used for the addressbook contact list and can be adapted, if you e.g. want to display custom fields in separat columns. If you modify "edit-xet" this will be used for the editing (or read only) of contacts.
* If you check for example /etemplates/addressbook/templates/default you see files like "edit.xet", "display.xet" and "index.xet". "display.xet" is used in CRM-view, so if you want to show there additional information of an organization e.g. a customer-number this can be added there. "index.xet" is used for the addressbook contact list and can be adapted, if you e.g. want to display custom fields in separat columns. If you modify "edit-xet" this will be used for the editing (or read only) of contacts.
* **If you have different contact or infolog types, its also possible to change "edit.xet" only for a specific type** by using the same name like the type. Simple example you have an additional contact type "Organisation" and like to use there an other etemplate. You name it "edit.Organisation.xet" and upload it to filemanager. As soon as you reload EGroupware the new etemplate is used instead of the original "edit.xet" for the contact of type "Organisation". If you change "edit.xet", upload it and reload the browser its used instead for all contact types. As soon as you delete the added file and reload an other time, you get again the original files we provide. So you can easily start and customizing ...
* **You can specify in the eTemplate also custom CSS** by adding at the end "styles" e.g.
`<styles>`
`.my_heading { font-weight: bold; font-size: 115%; `
`</styles>`
```
<styles>
.my_heading { font-weight: bold; font-size: 115%; `
</styles>
```
* **Or you can include some Javascript** which gets explicitly executed, while external Javascript would be blocked from CSP (contend security policy) by adding it between a tag "script" e.g. a simple example to set the title of an Infolog including a customfield
`<script>
app.infolog.set_title_custom = function(event, widget)
{
```
<script>
app.infolog.set_title_custom = function(event, widget)
{
let title = app.infolog.et2.getDOMWidgetById("info_subject");
let cf_1 = app.infolog.et2.getDOMWidgetById("#customfield1");
if(title &amp;&amp; !title.get_value())
if (title &amp;&amp; !title.get_value())
{
title.set_value("Some general text " + (cf_1 ? cf_1.get_value() : "")
);
}
return true;
};
</script>`
* **NEW**: **Customfields do not longer need a specific customfield tab** in the template and the et2-tabbox, they get generated automatically taking some general attributes/properties into account: cfPrepend="history" (the default is before history-tab or at the end, if there is no history, but you can specify also other tabs or leave it empty, so tabs get generated from the beginning!); cfExclude="customfield-name" (comma separated for multiple fields), cfTypeFilter="@info_type" (infolog) or cfTypeFilter="$cont[tid]" (addressbook) and cfPrivateTab="!$cont[no_private_cfs]" (Addressbook only, as app-config allows to get private custom fields in a seperate tab)
* **If you want to position a customfield e.g. "customer-number" in an other tab**, you specify in et2-tabbox cFExclude="customer-number" and in the tab where it should be displayed simply `<customfields id="#customer-number" span="2"/>`.
title.set_value("Some general text " + (cf_1 ? cf_1.get_value() : ""));
}
return true;
};
</script>
```
* **NEW**: **Customfields do not longer need a specific customfield tab** in the template and the et2-tabbox, they get generated automatically taking some general attributes/properties into account: cfPrepend="history" (the default is before history-tab or at the end, if there is no history, but you can specify also other tabs or leave it empty, so tabs get generated from the beginning!); cfExclude="customfield-name" (comma separated for multiple fields), `cfTypeFilter="@info_type"` (infolog) or `cfTypeFilter="$cont[tid]"` (addressbook) and `cfPrivateTab="!$cont[no_private_cfs]"` (Addressbook only, as app-config allows to get private custom fields in a separate tab)
* **If you want to position a customfield e.g. "customer-number" in an other tab**, you specify in et2-tabbox `cfExclude="customer-number"` and in the tab where it should be displayed simply `<customfields id="#customer-number" span="2"/>`.