Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This document describe best practice when create new page / template / widget in DOTCMS. It contain 4 3 part of building a page: 

  • Template
  • Page
    • HTML
    • JS
    • CSS
  • Widget
    • JS 
    • CSS

1. Create Template

...

2.  Create Page using Template 

Step 1: 

...

In site browser, select folder that you want to create page. Then click add page in menu. 

Image Added

Leave dropdown box option as default "Page Asset" → Select. 

Image Added

Enter needed information to create page, fields with Red title in required
1. Title: all characters are in normal case (a-z), dont use special characters & capital characters

2. Url: example: demo.html

3. Host or Folder: choose current folder & site

4. Template: select created template (in previous step) or a default template

5. Friendly name: Site Title

Image Added

In Advanced Properties tab. you can configure below information:

1. Redirect URL: replace all Relative URL in this page with a new one
Note:

- All Absolute URL & URLs in footer will not be affected by this configuration

2. Campaign Webkey: Used for Index - Pre-sale & Order page (most important). To declare webkey which is used to get price from CRM

3. Campaign Name: enter campaign name of entered webkey for better management. DONT LEAVE THIS BLANK if you already entered webkey.

4. Leave this blank if this page inherit GTM key of the site. 

Image Added

Click Save/Publish để kết thúc quá trình tạo page. Giao diện trang mới tạo sẽ như bên dưới

Image Added


Sử dụng Js (Javascript) trong trang

1. Vào thư mục src/js tạo hoặc upload file js cần sử dụng lên (ví dụ như trong hình dưới, file demo)

Image Added

3. Create & Add Widget 

  • Go to menu Types & Tag → Content Types 

...