PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • 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 is using a page template
  • Applying a template to an existing page
  • Opening the template associated with a page
  • Applying the modifications performed on a template
  • Running the test of 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/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
The page templates
Overview
WEBDEV allows you to create page templates. These templates contain all the graphic elements common to all the pages of your site.
The modifications performed in a page template are automatically applied to all the pages that use this template.
A page template allows you to comply with the style book defined for a site.
We recommend that you use templates in your WEBDEV sites rather than framesets. Indeed, 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).
  • simplify the creation of site pages.
  • simplify the layout of site pages.
  • simplify the update of style book defined for the site.
  • 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 ("File .. New .. Page .. Page template"). Create a new page template:
    • Click among the quick access buttons.
    • In the wheel that is displayed, hover "Page" and click "Page template". The window for creating a new element is displayed: click "Page" then "Page template".
  2. Specify (if necessary) whether the page template must:
    • be blank,
    • be based on one of the project templates,
    • using 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 processes associated with the page template.
    • the processes associated with the controls of page template.
      These processes will be automatically imported into the pages that use the template.
  5. Give a name to your template ("General" tab in the description window).
  6. Select "File .. Save".On the "Home" pane, in the "General" group, click "Save" (or click among 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 a name to your page ("General" tab in the description window of the page).
  5. Select "File .. Save as template". The current page becomes a template:On the "Home" pane, 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 "Templates of pages" section.
    • the extension of the template file is ".WWT".
Applying a page template

Creating a new page that is using a page template

To create a new page that is using a page template:
  1. Create a new page ("File .. New .. Page").Create a new page:
    • Click among the quick access buttons.
    • Click "Page" in the wheel that is displayed. In the window that is displayed, click "Page" then "Page".
  2. In the wizard, select your custom template in the "Blank/Template" tab.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. Select "Insert .. A template (Inheritance)".On the "Page" pane, 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.
Note: 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 popup menu of a template element, select "Open the template".
Other possibility:
  • List the templates associated with the page ("Page .. List of templates used").
  • Select the requested template and click the "Open the template" button ( ).
Other possibility:
  • List the templates associated with the page: on the "Page" pane, in the "Description" group, expand "Templates" and select "List of templates used".
  • Select the requested template and click the "Open the template" button ( ).
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 via "Page .. Update the associated pages".from the template: on the "Page" pane, in the "Description" group, expand "Templates" and select "Update the associated pages".
  • from any page that uses the template, by opening the list of templates used ("Page .. List of templates used") and by clicking the "Update" button.from any page that is using the template:
    • by opening the list of templates used: on the "Page" pane, in the "Description" group, expand "Templates" and select "List of templates used".
    • then by clicking the "Update" button.
  • Versions 17 and later
    from the page template, by clicking found in the template bar.
    New in version 17
    from the page template, by clicking found in the template bar.
    from the page template, by clicking found in the template bar.
Note: The modifications made to the template are applied according to the overloaded characteristics in the pages that use the template.
Running the test of a page template
To run the test of a page template:
  1. Open the template whose test must be run ("Page .. List of templates used", "Open the template" button).Open the template whose test must be run:
    • On the "Page" pane, in the "Description" group, expand "Templates" and select "List of templates used",
    • Click the "Open the template" button.
  2. Click the "Go" button ("Run the page test" icon) or select "Code .. Run the page test".Click among the quick access buttons.
List of templates used
To display the list of templates used for a page, select "Pages .. List of templates used".To display the list of templates used for a page, on the "Page" pane, in the "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:
WebFleet Complete examples (WEBDEV): WebFleet
[ + ] This Web application simulates the management of computer fleet.
The following topics are presented in this example:
1/ the page templates,
2/ the queries,
3/ the dialogs with the user,
4/ the graphic representation of a geographical location (computers in this case).
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.
See also
Minimum required version
  • Version 11
Comments
Click [Add] to post a comment