Editing Database Templates

Margarita Berezyanskaya

Last Update 2 months ago

After setting up a new Database, adding the Fields, and editing the Add entry template, it is good practice to add a couple of sample Database entries to test the Add entry template, and to see how things look on the View single, and View list tabs as well. If there are already example/model entries in the Database, or if any students have added an entry, the View list tab and any existing entries are the first thing they will see when they enter the activity depending on the activity settings.



Generally, the Add entry template will have all the fields included in it, as this is the form the students will fill out. Many teachers like to have the complete set of fields for the View single template as well, this will show learners everything they have entered on the Add entry tab after they save their work. If enabled, students can also edit their entries from the View single (or View list) tab as well. See the section on Available tags below for more on this point.


The View list template is often used as a quick summary view of the complete entries, this enables students to see multiple entries with only the most important information displayed, rather than all the information at once in multiple entries on one page, this can greatly reduce the scrolling and increase the engagement of learners in the task at hand. In the steps that follow, you will learn how to quickly transfer your editing from the Add entry template to the View single and View list templates in turn. The following steps will also cover the use of the Available tags on the Single template.


For this article, the Students in My Class Database that was used in the Adding Database Fields article will continue to be used and has had two example entries added to it for demonstration purposes. See the images below for what the default View list tab and View single tab look like without any editing:

View list

View single


Clearly these tabs are not conducive to reading, nor are they appealing to the eye. To begin with, having edited the Add entry template already in the previous steps, it can be a simple matter of

copying the Add entry template and then pasting it into the View single template to give it the same look as the form that learners will fill out on the Add entry tab.


1. Clicking on Single template under the Template tab will open it for editing the interface for viewing single entries in the Database one at a time.
Note: There is no Header or Footer output editing area for the Single template, as these are not available for the Single or Add entry tabs. But the Available tags, Reset template button, Disable editor button, and Save template button are available as in the View list template above. 
The image below shows what the (2) Single template page looks like under the (1) Templates tab.


As on the Add entry template, the Available tags window includes the Fields (3), but in the Single template there are also the tags: Actions (4), and Other tags (5).


Note the connection with the green arrow between the Single template (7) and the Actions (4) and Other (5) tags. These Actions and Other tags can add more options and/or information about the entries to both the View single and View list templates. For example, the Actions tag - ##edit## creates an editing icon when entries are viewed to allow users to edit entries in the Database if they have the necessary permissions to do so. To view the complete list of Fields and Tags, use the (6) scroll bar on the right-hand side of the window to move up and down the list.



2. Next, click on the Add template on the Templates tab, highlight the part of the table that you want in the Add template, copy it with the keyboard shortcut [Ctrl] + [c], or by pressing the [Ctrl] key and doing a right-click of your mouse and selecting 'copy'. Note that in the example below, the instructions in the top row are not highlighted to copy as they are only for the Add entry tab.



3. Return to the Single template, and highlight the rows that you want to replace in the table. Right-click on the highlighted area to select the row, and delete it. Be careful not to delete the Actions tags, unless they don't suit your purpose.



4. Complete the transfer of the Add entry template formatting by now pasting the copied table into the Single template with the keyboard [Ctrl] + [v], or with [Ctrl] and a right-mouse click and then by selecting Paste.


5. The copied information will appear in the Single template.



6. Click on the Save template button to save the editing, and then click on the View single tab to see what the changes look like. Note the Actions tag icons that appear at the bottom of the table.



7. If you would like to remove, or add more of the Actions and Other tags, return to the Single template.



In the Single template tab, delete any tags you do not want, for example, the ##approve## tag may not be necessary if approval is not in use for the Database.



To add a new tag to the Single template, place your cursor where you would like the tag and then click on the tag in the Available tags window. This will automatically add the tag for you.



If you would prefer to type the tags in this format ##taghere## you can, or, you can click on the Disable editor button and work in code if you prefer.


In this image, the ##approve## tag has been deleted and the ##timemodified## tag has been added with the first method above.



Remember to click on the Save template button to save the changes.


8. To see the results, after clicking on the Save template button, return to the View Single tab and look to the bottom to see the changes and new information from the ##timemodified## tag. Compare this image to the pictures in step 6 above to see the difference here.

 

 

Resources