A theme consists of UI elements such as logos, images, landing page text, background colors etc. WSO2 API Store comes with a default theme called
Fancy. The easiest way to change the user interface of the API Store is by customizing the default theme.
All themes have a folder structure similar to the following:
Since the default theme already has most of the UIs and JSON logic defined, in a typical scenario, you would not implement the theme from scratch. You can customize the default theme by bundling together the changes (e.g., CSS code, images) as a .zip file, and uploading it through the Admin Dashboard Web application. Once uploaded, the files in the .zip override the corresponding files in the default theme. The rest is inherited from the default theme.
- To override the default theme, ensure that you upload UI changes, fonts, and images as follows:
- UI changes as CSS code
- Fonts in SVG, TTF, EOT, WOFF, WOFF2 or OTF formats
- Images in JPG, PNG, or GIF formats.
Let's get started. See the video tutorial here or go through the step-by-step walk-through of the video tutorial below.
Here's a step-by-step walk-though of the video tutorial:
- Download the default theme from fancy.zip, unzip it and rename the folder according to the name of your new theme (e.g., ancient). Let's call this folder the
To change the logo of the API Store, replace
<THEME_HOME>/libs/theme-wso2_1.0/images/with the preferred logo.
- To change the favicon of the API Store, replace
<THEME_HOME>/images/favicon-store.pngwith a preferred icon.
- To change the logo of the API Store's self sign up page, replace the
<THEME_HOME>/images/logo-white.pngwith a preferred logo.
<THEME_HOME>/css/custom.cssfile using a text editor and add the following CSS code to the end of the file. Take a look at the code comments to understand what each line of code does.
- Since you plan to upload this as a sub-theme of the default main theme, delete all the files in your
<THEME_HOME>folder except the ones that you just edited. The rest of the files will be automatically applied from the main theme.
Go inside the
<THEME_HOME>folder, select all the files/folders inside it (Ctrl+A) and right click to archive all the selected files and folders together. Then rename the archive files to
Tip: Be sure to create the archive file by selecting all the files/folders (Ctrl+A) and right clicking on all the selected artifacts.
- Log in to WSO2 API Cloud by going to https://cloud.wso2.com, clicking the Sign In link and then selecting WSO2 API Cloud.
- Click the Admin Dashboard menu under the Configure menu to open the Admin Dashboard.
- The Admin Dashboard opens. Click SETTINGS -> UPLOAD TENANT THEME and upload your zip file (e.g., ancient.zip).
Open the API Store and the Signup page and note that your UI customizations are applied.
Tip: It can take up to 15 minutes for a new theme to be applied to the API Store.
In this tutorial, you applied a few selected UI changes to the API Store.