A theme consists of UI elements such as logos, images, copyrights messages, landing page text, background colors etc. WSO2 API Store comes with a default theme.
...
Because a main theme already has most of the UIs and the syntax and logic of Jaggery code defined, in a typical scenario, you do not have to implement a theme from scratch. Rather, you just add in your edits as a sub theme of the existing main theme as given below:
- Download the default main theme from here, unzip it and rename the folder according to the name of your new theme (e.g., ancient). Let's call this folder the
<THEME_HOME>.
- To change the logo of the API Store, replace the
logo.png
file inside the<THEME_HOME>/images
folder with this logo (or anything else of your choice.) - To change the copyrights note in the footer, open the
<THEME_HOME>/templates/page/base/template.jag
file using a text editor, search for the word "Copyright" and change the text. For example, let's add our company name as "copyright", "© Copyright 2011 – 2014 My Company." To change the header's background color, open the
<THEME_HOME>/css/styles-layout.css
file using a text editor and add the following CSS rule to the end of the file. It changes the header color to red.Code Block language css .header-menu div.navbar-inner div.container-fluid{ background:red{ background:#7e3330; }
- As 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 edited. The rest of the files will be automatically applied from the main theme.
...
- If you have access to the file system, save the
<THEME_HOME>
folder inside the<APIM_HOME>/repository/deployment/server/jaggeryapps/store/site/themes/fancy/subtheme
folder. This will make your new theme a sub theme of fancy. Open the
<APIM_HOME>/repository/deployment/server/jaggeryapps/store/site/conf/site.json
file and add the following code to it. It specifies the base theme asfancy
, which is overridden by the sub themeancient
.Code Block "theme" : { "base" : "fancy", "subtheme" : "ancient" }
- Open the API Store and note the new theme applied to it.
Uploading through the Admin Dashboard
...
- Go inside the
<THEME_HOME>
folder, select all the folders inside it and right click to archive all the selected files and folders together. Then rename the archive files toancient.zip.
- Log in to WSO2 Admin Dashboard Web application using the URL api.cloud.wso2.com/admin-dashboard. Give your user name as email@domain with the @ in the email replaced by a dot (e.g., john.gmail.com@MyCompany).
- Click the Upload Tenant Theme menu and upload your zip file.
- Open the API Store and note the new theme applied to it.