Oracle by Example brandingCreating a Theme in Oracle Visual Builder Cloud Service

section 0Before You Begin

This 15-minute tutorial shows you how to create a theme to define the look and feel of an Oracle Visual Builder Cloud Service application.

Background

A theme is an HTML fragment, along with one or more related CSS stylesheets and images, into which the content of an Oracle Visual Builder Cloud Service application is injected. Typically the theme defines the look and feel of the application, as well as the header, footer and page menu. You can inject other dynamic content into areas of the theme to display the logo, title, copyright message, language switcher, and menu structure defined by the application developer.

You can apply the theme you create to the application in which you create it. You can also share it and make it available to other applications. Finally, you can publish the application as a template so that other applications can use it.

The images in this tutorial show the standalone version of Oracle Visual Builder Cloud Service. If you are using the Oracle Integration Cloud version, you will see an additional menu at the top of each page that lets you switch between Visual Builder and Integration Cloud.

Top menu
Description of the illustration vbcs_oic_menu.png

What Do You Need?

  • Access to Oracle Visual Builder Cloud Service
  • A supported browser (see Known Issues for Oracle Visual Builder Cloud Service for more information)
  • A thorough knowledge of JavaScript and web application development

section 1Create a Simple Application

  1. In the web browser, log in to Oracle Visual Builder Cloud Service.
  2. On the Home page, click + New Application and select Web.
    Oracle Visual Builder Cloud Service Home page
    Description of the illustration vbcsct_t1_s2.png
  3. On the first page of the Create Application wizard, enter the following:
    • Application Name: Theme Application
    • Description: Theme tutorial application

    The Application ID text field is automatically populated based on the Application Name.

    Application Name page in Create Application wizard
    Description of the illustration vbcsct_t1_s3.png

    Click Next.

  4. On the next page, select the Oracle Applications Cloud UI template, and then click Next.
    Application Template page in Create Application wizard
    Description of the illustration vbcsct_t1_s4.png
  5. On the last page, click Finish.

    By default, one tab with Home as its label is available.

    Application Navigation page in Create Application wizard
    Description of the illustration vbcsct_t1_s5.png
  6. Your application is created and opens in the Page Designer. Click the Themes palette to view the currently available themes. Three themes are provided by default: Oracle Alta UI, Oracle Applications Cloud UI, and Oracle Applications Cloud UI R12.
    Application in Page Designer
    Description of the illustration vbcsct_t1_s6.png

section 2Create a Theme

  1. Click the Main menu icon and select Application Settings.
    Application Settings main menu item
    Description of the illustration vbcsct_t2_s1.png
  2. Click the Extensions tile.
    Application Settings page
    Description of the illustration vbcsct_t2_s2.png
  3. On the Extensions page, click the Theme tab.
    Theme icon on Extensions page
    Description of the illustration vbcsct_t2_s3.png
  4. Click + New Theme and select Create new.
    Create New Theme list selection
    Description of the illustration vbcsct_t2_s4.png
  5. On the first page of the Create New Extension wizard, enter the following, then click Template.
    • Display Name: MyTheme
    • Extension ID: com.example.MyTheme (at least two groups of letters or numbers separated by a period)
    • AMD Package Name: com.example.MyTheme (automatically populated)
    • Description: My example theme
    Create New Extension wizard
    Description of the illustration vbcsct_t2_s5.png
  6. On the Available Templates page of the wizard, select Simple Theme, then click OK.
    Create New Extension wizard
    Description of the illustration vbcsct_t2_s6.png
  7. The Overview tab of the theme opens. Toggle the Extension Active icon to enable the theme. A message reports that the extension has been enabled.
    Overview tab of theme page
    Description of the illustration vbcsct_t2_s7.png
  8. Click Sources to open the files in the Resource Browser.
    Overview tab of theme page
    Description of the illustration vbcsct_t2_s8.png
  9. If necessary, expand the nodes in the Resource Browser and view the file names (you may need to widen your web browser window to see them).
    Sources tab with theme files
    Description of the illustration vbcsct_t2_s9.png

    You can perform most simple theme customizations by modifying two of the files, layout.html (the HTML source of the theme) and style.css (the associated CSS file). You'll make these modifications in the next section.

    For more information on the files that make up a theme, see Using Oracle Visual Builder Cloud Service.

  10. Click the Main Menu Main menu icon and select Page Designer to return to the Page Designer.
    Page Designer main menu item
    Description of the illustration vbcsct_t2_s10.png
  11. Click the Themes palette. Scroll down to see the new theme, MyTheme, in the palette. It has a default icon.
    Themes Palette
    Description of the illustration vbcsct_t2_s11.png
  12. Click the Main Menu Main menu icon and select Application Settings, then Extensions, to return to the Themes tab on the Extensions page.
    Themes Palette
    Description of the illustration vbcsct_t2_s12.png

section 3Customize the Theme Layout

In this section, you'll customize the layout of your new theme. You'll modify layout.html to add a new help panel that floats to the side of the main content window.

The Sources tab provides a basic editor. If you want to do more extensive editing, you can export the extension to your system as a ZIP file, edit the files in a local editor, and then use the Resource Browser under Application Settings to import the zip file to the extensions directory. You could also select and copy the contents of an individual file, edit it in a local editor, and then paste it back into the Sources tab editor.

  1. From the Overview page for MyTheme, click the Sources tab.
    Overview tab of theme page
    Description of the illustration vbcsct_t3_s1.png
  2. In the Resource Browser, expand the nodes (if necessary) and navigate through the directory hierarchy to find the layout.html file, under user/extensions/com.example.MyTheme/theme/.
    Sources tab with theme files
    Description of the illustration vbcsct_t3_s2.png
  3. Click the layout.html file to display its contents.
    Editor pane with layout.html file
    Description of the illustration vbcsct_t3_s3.png
  4. Select the div element with the ID value "abcs-app-content". It's almost at the end of the file, between the header and the footer.
    <div id="abcs-app-content">
        <!-- page content placeholder -->
    </div>
    Part of layout.html file
    Description of the illustration vbcsct_t3_s4.png
  5. Replace that code with the following, which moves it under a higher-level div element with the ID value "my-layout-container". Don't worry about the formatting.
    <div id="my-layout-container">
        <div id="abcs-app-content">
            <!-- page content placeholder -->
        </div>
        <div class="help-panel">
            Help! This is where you could add basic information on how to use the application.
        </div>
    </div>
    Part of changed layout.html file
    Description of the illustration vbcsct_t3_s5.png
  6. Click Save Changes.
    Save Changes button
    Description of the illustration vbcsct_t3_s6.png

section 4Customize the Theme Style

In this section, you'll customize the style of your new theme. You'll modify style.css to change the color scheme and add some styling to the help panel.

  1. Click the file style.css, in the same directory as layout.html, to display its contents.
    Part of style.css file
    Description of the illustration vbcsct_t4_s1.png
  2. Locate the following section, at lines 27-28.
    .abcs-bg-container {
        background-color: #F0F0F0; }
  3. Replace the background color setting with the following to change the background color to yellow.
    .abcs-bg-container {
        background-color: #fcde8a; }
    Modified line of style.css file
    Description of the illustration vbcsct_t4_s3.png
  4. To style the new help panel, add the following at the start of the file.
    .help-panel {
        width: 25%;
        background-color: #fbce4a;
        border-radius: 5px;
        padding: 10px 10px 10px 10px;
        margin-right: 10px;
        margin-top: 3px;
    }
    #my-layout-container {
        display: flex;
    }
    New code at top of style.css file
    Description of the illustration vbcsct_t4_s4.png
  5. Finally, make the main application content narrower to fit in the help panel. Find the section for #abcs-app-content (line 261) and add a line that sets the width to 75%.
    #abcs-app-content {
        width: 75%;
        margin-bottom: 10px;
        padding: 0px 10px 10px 10px;
        -webkit-flex-grow: 1;
        -ms-flex-positive: 1;
        flex-grow: 1;
        -webkit-flex-shrink: 0;
        -ms-flex-negative: 0;
        flex-shrink: 0; }
    Added line in style.css file
    Description of the illustration vbcsct_t4_s5.png
  6. Click Save Changes, then click Reload Extensions.
    Reload Extensions button
    Description of the illustration vbcsct_t4_s6.png
  7. Click the Main Menu Main menu icon and select Page Designer to return to the Page Designer.
    Page Designer main menu item
    Description of the illustration vbcsct_t4_s7.png
  8. Click the Themes palette and select MyTheme.
    Theme Palette
    Description of the illustration vbcsct_t4_s8.png

    The application is re-rendered with the new layout. You may need to refresh the browser to see the help panel.

    Application with new theme
    Description of the illustration vbcsct_t4_s8_result.png

    The new help panel you created is not part of the content area of the application, but only part of the wrapper around the content area. In the Page Designer, you can drag components only into the content area specified by the ID "abcs-app-content". To add content to the help panel, you would have to edit the theme in the Extensions page, modifying the contents of the div element that has the ID "help-menu".


more informationWant to Learn More?