DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

Extension overview

Edit the extension “sav_library_example8” in the SAV Library Kickstarter to get an overview. It contains:

  • Two forms (USER, ADMIN),
  • Five views (USER_List, User_Edit, ADMIN_List, ADMIN_Single, ADMIN_Edit),
  • Two queries (USER_Query, ADMIN_Query).

The organization of the forms is quite similar to the previous examples. Just click on them to analyze it. Let us focus on the configurations associated with the existing table “fe_users” by clicking on the link “fe_users”. As it can be seen, all fields have type “Only shown in SAV Form”.

../../_images/Tutorial8KickstarterFeUsersTableImport.png

When the extension was created, by clicking on the link Import fields from table as “Only shown in SAV form” , all fields from the table “fe_users” were imported, then unwanted fields were removed.

The user form (USER)

In this example, it was chosen to design a very simple form consisting in the display of the user image field. The image is associated with a link to open the user form in the edit mode.

The query USER_Query

The query is used to filter the “fe_users” table with the authenticated user. This is easily done by using the marker ###user### in the WHERE clause of the query.

../../_images/Tutorial8KickstarterUserQuery.png

The views USER_List and USER_Edit

The template associated with these views is quite simple since the only field to display is “image”.

../../_images/Tutorial8KickstarterUserListView.png

And to make it possible to generate the link to open the input view, only a few configuration attributes are required.

../../_images/Tutorial8KickstarterFieldConfiguration.png
  • “func = makeItemLink;” generates the link for the current item.
  • “edit = 1;” opens the edit view instead of the default view (“single” view).
  • “width = 50;” and “height = 50;” define the size of the image.

Because there is no “Single” view associated with the user form, the default “Edit” view title bar must be changed, in particular the “save and show” and the “show button” must be removed. The example comes a directory “Resources/Private/Partials” which contains two directories “TitleBars” and “Footers”. They respectively contain a folder “EditView” which contain themselves a new “default.html” Fluid file. We will see later how to call these new “Partials”.

Finally, to override the default css, the example comes with a css file (sav_library_example8.css) in the “Resources/Private/Styles” directory which contains the following instructions :

.sav_library_example8_user .savLibraryPlus .listView {width:62px;background-color:#ffffff;}
.sav_library_example8_user .savLibraryPlus .listView .titleBar {display:none;}
.sav_library_example8_user .savLibraryPlus .listView .items .item {border:none;background-color:#ffffff;}

Concerning the view USER_edit, there is no specific configuration that needs to be described here. Fields are selected and attributes “fusion = begin;” and “fusion = end;” are used to group fields.

The administration form (ADMIN)

The administration form is used in the Front End to manage, give rights, export FE users. It is based on a conventional query, “List”, “Single” and “Edit” views for which no specific configuration is needed. Just click on the different views and tabs to see how fields are grouped.