U bekijkt help-inhoud voor de versie::

In this section, you create the following pages which all use the page template:

  • SCF Sandbox Site, which will redirect to the English version of the main page
    • SCF Sandbox - the main page for the English version of the site
      • SCF Play - child of the main page on which to play

Although this tutorial does not delve into language copies, it is designed so the root page may implement detection of the preferred language for the user through the HTML header, and redirect to the appropriate main page for the language.  The convention is to use the two-letter country code for the node name of the page, e.g., "en" for English, "fr" for French, and so on.

Create First Pages

Now that there is a page template, we can establish the root page of the website in the /content directory.

  1. The touch-optimized UI currently provides blueprints for creating sites.  As this tutorial is creating a simple site, the classic UI is useful.

    To switch to the classic UI, select global navigation and hover over the right side of the Projects icon.  Select the "Switch to Classic UI" icon which appears:

    chlimage_1
  2. From the classic UI Welcome page, select Websites.

    chlimage_1

    Alternatively, access the classic UI for Websites directly by browsing to /siteadmin.

  3. In the explorer pane, select Websites and then in the toolbar select New > New Page.

    In the Create Page dialog, enter the following:

    • Title: SCF Sandbox Site
    • Name: an-scf-sandbox
    • select An SCF Sandbox Play Template
    • click Create
    chlimage_1
  4. In the explorer pane, select the page you just created, /Websites/SCF Sandbox Site, and click New > New Page :

    • Title: SCF Sandbox
    • Name: en
    • select An SCF Sandbox Play Template
    • click Create
  5. In the explorer pane, select the page you just created, /Websites/SCF Sandbox Site/SCF Sandbox, and click New > New Page :

    • Title: SCF Play
    • Name: play
    • select An SCF Sandbox Play Template
    • click Create
  6. This is how the website now appears in the Websites console.  Notice that child pages of the item selected in the explorer pane are displayed in the right pane where they can be managed.

    chlimage_1

     

    This is the repository view of what was created using the Website tool and the template:

     

    chlimage_1

Add the Design Path

When /etc/designs/an-scf-sandbox was created using the designs section of the Tools console, the property

  • cq:template="/libs/wcm/core/templates/designpage"

was defined, which provides the optional ability to reference design assets in a script using currentDesign.getPath().  For example

  • <% String favIcon = currentDesign.getPath() + "/favicon.ico"; %>

This provides a single entry to edit if the location of designs changes, such as for a new version.

To link pages to the design, using CRXDE Lite add the cq:designPath property :

  1. select node /content/an-scf-sandbox/en/jcr:content
  2. in the entry area at the bottom of the Properties tab, type the following values for a new property:
    • Name: cq:designPath
    • Type: String 
    • Value: /etc/designs/an-scf-sandbox
  3. Click the green  [+] Add
The respository should appear as follows:

 

chlimage_1
  • click Save All

[ Trouble saving? Re-login! ]

 

Opmerking:

The use of cq:designPath is optional and is unrelated to the use of clientlibs, which are essentially required as the SCF components use clientlibs to manage their JS and CSS.

Dit werk is gelicentieerd onder de Creative Commons Naamsvermelding/Niet-commercieel/Gelijk delen 3.0 Unported-licentie  De voorwaarden van Creative Commons zijn niet van toepassing op Twitter™- en Facebook-berichten.

Juridische kennisgevingen   |   Online privacybeleid