In this exercise, you will customize the default developer portal that comes with 3scale API Management.
Outcomes
You should be able to:
Change the company name
Upload a custom logo and use it within the developer portal
Customize the developer portal colors and theming
Create a custom page within the developer portal
Add a navigation item to the developer portal
As the student user on the workstation machine, use the lab command to prepare your system for this exercise.
This command ensures that:
Red Hat OpenShift Container Platform (RHOCP) is accessible
3scale API Management is installed
Required files exist on the workstation machine
[student@workstation ~]$ lab start portal-customizing
Procedure 5.2. Instructions
Update the company name for use within the developer portal.
Within a web browser, navigate to the 3scale API Management Admin Portal.
The URL to the Admin Portal is https://3scale-admin.apps.ocp4.example.com.
Using the top pane navigation drop-down, click .
Next to Account Details, click .
Change the organization name to Bob's Boxes and click .
Review the default look and feel of the developer portal.
Using the top pane navigation drop-down, click .
Preview the current version of the developer portal by clicking .
Close the CMS toolbar by clicking the (close) button in the top right corner.
Review the default style and theme of the portal.
Notice the blue theme and that the company name is Bob's Boxes.
Leave this tab open because you will visit the portal several times to view your changes.
Add a custom company logo to the navigation of the portal.
Within the Admin Portal, navigate to → and upload the file ~/DO240/labs/portal-customizing/icon.png.
Navigate to → .
This area displays the structure and content of your developer portal. The right side of the page is further divided into two sections: the file hierarchy and file editing.
Within the file hierarchy, under the Layouts heading, select the file called Main layout.
This file provides the structure for many of the pages within the default developer portal.
Modify the contents of the file by adding an img tag referencing the provider.logo_url variable.
After your updates, the file should match the following contents:
...output omitted...
<nav class="navbar navbar-fixed-top navbar-inverse" role="navigation">
<div class="container tabbed">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">
<img src="{{ provider.logo_url }}" height="32px" />
{{ provider.name }}
</a>
</div>
{% include 'submenu'%}
</div>
</nav>
...output omitted...Deploy your changes to the developer portal by clicking at the bottom of the file editing panel.
Select the developer portal tab and refresh the page to view the logo in the navigation bar.
Customize the style of the developer portal by modifying the included CSS file.
Within the Admin Portal tab, select the default.css file from the file hierarchy.
Modify the background color of the body selector to orange.
The file should match the following excerpt:
...output omitted... body { background-color:darkorange; /* fallback */ background-color:rgb(255, 140, 0); ...output omitted... } ...output omitted...
Deploy your changes to the developer portal by clicking at the bottom of the file editing panel.
Select the developer portal tab and refresh the page to view the color theme change to orange.
Add a new page to the developer portal that shows company information.
Within the Admin Portal, open the file called Documentation.
Click at the top right.
Fill out the form according to the following table:
| Field | Value |
|---|---|
| Title | About |
| Path | /about |
Within the Advanced Options section, make sure Liquid enabled is checked.
Leave all other fields as their default values and click .
Update the contents for the about page by pasting the following HTML snippet into the editor:
<h1>About</h1> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam accumsan est id neque interdum posuere. Ut eleifend et sapien nec pharetra. Vivamus condimentum magna vitae justo rutrum, non vestibulum odio ultricies. Morbi eget sem sit amet erat dapibus molestie. Nullam nec felis et massa tincidunt interdum. Integer imperdiet nisi ac lacus feugiat pretium. Suspendisse accumsan consequat augue, a feugiat metus commodo sed.</p>
Deploy your changes to the developer portal by clicking at the bottom of the file editing panel.
Select the developer portal tab and navigate to https://3scale.apps.ocp4.example.com/about to view the new about page.
Add a button to the navigation for the about page.
Within the Admin Portal tab, open the file called submenu under the Partials heading.
Update the contents of the partial to include an anchor tag for the about page. The file should match the following excerpt:
...output omitted... {% if current_user %} ...output omitted... <li><a class="{% if urls.docs.active? %}active{% endif %}" href="/docs">Documentation</a></li><li class="{% if request.path == "/about" %}active{% endif %}"> <a href="/about">About</a> </li></ul> ...output omitted... {% else %} <ul class="nav navbar-nav"> <li><a href="/docs">Documentation</a></li> <li><a href="/#plans">Plans</a></li><li class="{% if request.path == "/about" %}active{% endif %}"> <a href="/about">About</a> </li></ul> ...output omitted... {% endif %} </div>
Deploy your changes to the developer portal by clicking at the bottom of the file editing panel.
Select the developer portal tab and refresh the page. Use the navigation at the top of the page to navigate between the different pages, including the new about page.
This concludes the guided exercise.