examples:builder:multi_attachment

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
examples:builder:multi_attachment [2020/09/18 20:17]
pdsci
examples:builder:multi_attachment [2021/12/09 10:56] (current)
pdsci-admin [Multiple media/file attachment: attachMany]
Line 2: Line 2:
  
 ====== Multiple media/file attachment: attachMany ====== ====== Multiple media/file attachment: attachMany ======
-With the //attachMany// function multiple files like images, movies or documents can be attached to a record of a database table. Media attachments are using built-in relations of OctoberCMS. So it is very easy to implement them.+With the //attachMany// function multiple files like images, movies or documents can be attached to a record of a database table. Media attachments are using built-in relations of WinterCMS. So it is very easy to implement them.
  
 <WRAP tip> <WRAP tip>
Line 30: Line 30:
   * how to create a plugin with builder   * how to create a plugin with builder
   * how to create tables and forms with builder   * how to create tables and forms with builder
- 
- 
- 
  
 ===== Step 1: Extend the base model ===== ===== Step 1: Extend the base model =====
Line 56: Line 53:
 \\ \\
  
 +===== Step 2: Prepare the form =====
 +Next step is to complete the form with an additional field - the **File upload** widget to upload and display media and/or files:\\
 +
 +{{:examples:builder:attachmany.3.field.jpg?direct&960 |Add widget fileUpload}}
 +<WRAP clear />
 +\\
 +===== Step 3: Upload media/files =====
 +
 +Finally, in the backend form view of the plugin, a file can be uploaded by clicking on the //file upload symbol// - the area below the 'Page Views' title in the example:\\
 +
 +{{:examples:builder:attachmany.4.final-upload.jpg?direct&960 |}}
 +<WRAP clear />
 +\\
 +Now the form is ready to attach multiple images and/or files to each record.\\
 +----
 +\\
 +Back to [[:start|Start Page]]