ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing an application or website / Controls, windows and pages / Page template
  • Overview
  • Creating a page template
  • Creating a page template
  • Creating a page template from an existing page
  • Applying a page template
  • Creating a new page that uses a page template
  • Applying a template to an existing page
  • Opening the template associated with a page
  • Applying the modifications performed on a template
  • Testing a page template
  • List of templates used
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Overview
WEBDEV allows you to create page templates. These templates contain all the graphic elements common to all the pages of your site.
The changes made to the page template are automatically applied to all the pages that use this template.
A page template allows you to use the style book defined for a site.
It is recommended to use templates in your WEBDEV sites rather than framesets. Using page templates in your sites allows you to:
  • optimize the speed when displaying the pages of the site.
  • limit the number of generated HTML files (and therefore the number of HTML files downloaded to the computer of the Web user).
  • easily create the site pages.
  • define the layout of the site pages.
  • easily update the site style book.
  • simplify the management of targets for the site pages.
  • ...
Creating a page template
A page template can be created:
  • directly, like any other page.
  • from an existing page.

Creating a page template

To create a page template:
  1. Create a new page template:
    • Click in the quick access buttons.
    • The new element window appears: click "Page" then "Page template".
  2. Specify (if necessary) whether the page template must:
    • be blank,
    • be based on one of the project templates,
    • use a preset template.
  3. Create all the necessary controls. These controls will be included in all the pages that use the page template.
  4. Enter (if necessary):
    • the WLanguage events / processes associated with the page template.
    • the WLanguage events / processes associated with the different controls of the page template.
      These events and processes will be automatically imported into the pages that use the template.
  5. Give your template a name ("General" tab of the description window).
  6. On the "Home" tab, in the "General" group, click "Save" (or click in the quick access buttons).
The page template corresponds to a file whose extension is ".WWT".

Creating a page template from an existing page

To create a page template from an existing page:
  1. Open the page chosen as template.
  2. Keep the controls required by the template. These controls will be included in all the pages that use the page template.
  3. Keep the code of processes required by the template. These processes will be automatically imported into the pages that use the template.
  4. Give your page a name ("General" tab of the page description window).
  5. On the "Home" tab, in the "General" group, expand "Save" and select "Save as template". The current page becomes a template:
    • its name is preceded by "Template".
    • a yellow border appears around the page in the page editor.
    • the page template appears in the "Project explorer" pane, in the "Page templates" section.
    • the extension of the template file is ".WWT".
Applying a page template

Creating a new page that uses a page template

To create a new page that uses a page template:
  1. Create a new page:
    • Click in the quick access buttons.
    • In the window that is displayed, click "Page" then "Page".
  2. In the wizard, select "Page" on the left and select your custom template on the right.
  3. Validate the creation of the page. A blank page associated with your page template is created.
A yellow square is used to identify the elements belonging to the page template. These elements can be modified:
  • in the page template: the modification will be effective for all the pages that use this template.
  • in the page, with the mechanism for "control overload": the modification will be effective for the page only.

Applying a template to an existing page

To apply a template to an existing page:
  1. Display the page in the page editor.
  2. On the "Page" tab, in the "Description" group, expand "Templates" and select "Inherit from a template".
  3. Select the page template to apply.
  4. Validate.
  5. Specify whether you want to refresh the page properties from the template. If you answer Yes, the page will be automatically linked to the template for most of its characteristics.
Remark: the properties of the page generated by the template are as follows: Image, fixed background image, background color, text color, link color, color of visited link, color of active link, underlined link, center the page, anchor the controls in the page, title, control for displaying the progress bar, position of Ajax progress bar.
Opening the template associated with a page
To open the template associated with a page:
  1. Display the page in the page editor.
  2. In the context menu of a template element, select "Open template".
Other possibility:
  • List the templates associated with the page: on the "Page" tab, in the "Description" group, expand "Templates" and select "List of templates used".
  • Select the desired template and click "Open template" ().
Applying the modifications performed on a template
When a page template is modified, the modifications can be applied to one ore more pages that use this template in the current project.
Applying the modifications is proposed when closing the template (if the modifications have not been saved).
This operation can be performed at any time:
  • from the template: on the "Page" tab, in the "Description" group, expand "Templates" and select "Update associated pages".
  • from any page that uses the template:
    • by opening the list of templates used: on the "Page" tab, in the "Description" group, expand "Templates" and select "List of templates used".
    • then by clicking the "Update" button.
  • from the page template, via the icon in the template bar.
Remark: The modifications made to the template are applied according to the overloaded characteristics in the pages that use the template.
Testing a page template
To test a page template:
  1. Open the template to be tested:
    • On the "Page" tab, in the "Description" group, expand "Templates" and select "List of templates used",
    • Click "Open template".
  2. Click in the quick access buttons.
List of templates used
To view the list of templates used in a page, go to the "Page" tab, "Description" group, expand "Templates" and select "List of templates used".


From this window, you can:
  • "Open a template": opens the selected template in the page editor.
  • "Update": the controls and the code of the template are updated in the page.
  • "Add": adds a template to the current page.
  • "Dissociate": the template controls found in the page are dissociated from the template. The template is deleted from the list of templates used but its controls are not deleted from the page.
  • "Delete": deletes the template (controls and code) from the page.
Related Examples:
WW_Wizard Training (WEBDEV): WW_Wizard
[ + ] WEBDEV allows you to create your own Web wizards, via the WLanguage PageDisplayDialog function that is used to display a page in a modal way.

This allows you to establish a dialog with the user.
To go from a wizard plane to another one, all you have to do is use the concept of plane found in WEBDEV.
WW_Rewali Complete examples (WEBDEV): WW_Rewali
[ + ] This example is a site for travel booking.

It proposes travels at very attractive prices.
You have the ability to choose the travel duration, the start dates, then validate the purchase until the payment via Paypal.

It is using the "scrolling banner" control and the planes.
Minimum version required
  • Version 11
Comments
Click [Add] to post a comment

Last update: 09/13/2023

Send a report | Local help