Versions Compared

Key

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

In WSO2 ES, there are pages that are specific to a specific asset type and also there are global pages that affect all the asset types. The following sections explain how you can locate the partials that correspond to the page that you wish to override:

Table of Contents

Note

See Details of Default Partials to get For information on all the default partials in the Store and Publisher, see Details of Default Partials.

Locating an asset type specific partial

...

  1. Navigate to the page that possesses the partial that you want to edit.
  2. Identify the name of the corresponding renderer. 
    For example, if you wish to edit a partial in the My Bookmarks page and if the URL is as follows, then the name of the corresponding renderer is my-items.
    https://localhost:9443/store/pages/my-items 
  3. Navigate to the directory that WSO2 ES uses to maintain the page renderer. This varies based on whether the page is in the Store or the Publisher. The renderers for the Store and Publisher are available in the following directory paths:

    WSO2 ES ComponentDirectory
    Publisher<ES_HOME>/repository/deployment/server/jaggeryapps/publisher/themes/default/renderers/pages
    Store<ES_HOME>/repository/deployment/server/jaggeryapps/store/themes/store/renderers/pages
  4. Identify the renderer that corresponds to the page. The name of the renderer is always identical to the name of the page (e.g., The renderer that corresponds to the my-items page is my-items.js). 

  5. Identify the partials that you wish to override. You can find all the partials that WSO2 ES uses to render the a specific page defined in the renderer.
    Example:
    The following code snippet is from the my-items.js file. 

    Code Block
    var render = function(theme, data, meta, require) {
        var navigation = 'navigation';
        var navigationContext = data;
        switch (data.assetTypeCount) {
            case 1:
                navigation = 'navigation-single';
                break;
            default:
                break;
        }
        theme('2-column-right', {
            title: data.meta.title,
            header: [{
                partial: 'header',
                context: data
            }],
            navigation: [{
                partial: navigation,
                context: navigationContext
            }],
            body: [{
                partial: 'my_items',
                context: data
            }],
            right: [{
                    partial: 'recent-assets',
                    context: data
                }
                // {
                //     partial: 'tags',
                //     context: data.tags
                // }
            ]
        });
    };

    Based on the above code snippet, you can see that WSO2 ES uses the following partials within my-items.js renderer to render the my-items page.

    Page LocationRendered Partial

    header

    header
    navigationnavigation
    bodymy_items
    rightrecent-assets
  6. Locate the .hbs file with the partial definition related to the page that you wish to override. The location of the partial varies based on whether the page is in the Store or the Publisher. The partials for the Store and Publisher are available in the following directory paths:

    WSO2 ES ComponentDirectory
    Publisher<ES_HOME>/repository/deployment/server/jaggeryapps/publisher/themes/default/partials
    Store<ES_HOME>/repository/deployment/server/jaggeryapps/store/themes/store/partials
  7. Optionally, if the selected partial is made up of a set of child partials, locate the child partial in the latter mentioned partials directory. For more information on how to locate a nested partial see, Locating a Partial.

...

  1. Navigate to the page that possesses the partial that you want to edit.
  2. Identify the name of the corresponding renderer. 
    For example, if you wish to edit a partial in the Advanced Search page and if the URL is as follows, then the name of the corresponding renderer is advanced-search.
    https://localhost:9443/store/pages/advanced-search 
  3. Navigate to the directory that WSO2 ES uses to maintain the page renderer. This varies based on whether the page is in the Store or the Publisher. The renderers for the Store and Publisher are available in the following directory paths:

    WSO2 ES ComponentDirectory
    Publisher<ES_HOME>/repository/deployment/server/jaggeryapps/publisher/extensions/app/<APP_EXTENSION>/themes/default/renderers/pages
    Store<ES_HOME>/repository/deployment/server/jaggeryapps/store/extensions/app/<APP_EXTENSION>/themes/store/renderers/pages
  4. Identify the renderer that corresponds to the page. The name of the renderer is always identical to the name of the page (e.g., The renderer that corresponds to the advanced-search page is advanced-search.js). 

  5. Identify the partials that you wish to override. You can find all the partials that WSO2 ES uses to render the a specific page defined in the renderer.
    Example:
    The following code snippet is from the advanced-search.js file. 

    Code Block
    var render = function(theme, data, meta, require) {
        theme('2-column-right', {
            title: 'Store | Advanced Search',
            header: [{
                partial: 'header',
                context: data
            }],
            navigation: [{
                partial: 'advance-search-navigation',
                context: data
            }],
            body: [{
                partial: 'advanced-search-body',
                context: data
            }]
        });
    };

    Based on the above code snippet, you can see that WSO2 ES uses the following partials within advanced-search.js renderer to render the advanced-search page.

    Page LocationRendered Partial

    header

    header
    navigationadvance-search-navigation
    bodyadvanced-search-body
  6. Locate the .hbs file with the partial definition related to the page that you wish to override. The location of the partial varies based on whether the page is in the Store or the Publisher. The partials for the Store and Publisher are available in one of the following directory paths:

    WSO2 ES ComponentDirectory
    Publisher<ES_HOME>/repository/deployment/server/jaggeryapps/publisher/themes/default/partials
    <ES_HOME>/
    repository/deployment/server/jaggeryapps/publisher/extensions/app/<APP_EXTENSION>/themes/default/partials
    Store<ES_HOME>/repository/deployment/server/jaggeryapps/store/themes/store/partials
    <ES_HOME>/repository/deployment/server/jaggeryapps/store/extensions/app/<APP_EXTENSION>/themes/store/partials
  7. Optionally, if the selected partial is made up of a set of child partials, locate the child partial in the latter mentioned partials directory. For more information on how to locate a nested partial see, Locating a Partial.

...

The above command renders the partial named myPartial. When the partial executes, WSO2 ES runs the child partial under the current execution context.

...