31,003
edits
| Line 65: | Line 65: | ||
= Replace a view form with your own template = | = Replace a view form with your own template = | ||
Using your own view form for a record saved using your own create form is as simple as adding a file called | |||
'''/mymodule/canvas/mycanvas/tpl/tabname_view.tpl''' | |||
where | |||
* '''mymodule''' directory is value mymodule you used as canvas parameter to create record (see previous chapter). | |||
* '''mycanvas''' is value mycanvas you used as canvas parameter to create record (see previous chapter). | |||
* '''tabname''' is name of tab or page to edit record. In most cases it is value "card". | |||
With our canvas demo societe@company, view template will be into file | |||
'''/societe/canvas/company/tpl/card_view.tpl''' | |||
Note that for view, changing URL is not necessarly required. Dolibarr can detect your record is a personalized canvas record and automatically scan for this template file to show it if found. If not, standard form will be used. So all you have to do to use your own view template is copy and paste an existing demo view template file and rename it with correct value of mymodule and mycanvas and edit it to match your need. | |||
= Add code to manage new fields = | = Add code to manage new fields = | ||
{{ToComplete}} | {{ToComplete}} | ||