Now let’s make use of the new city content type and part component. First we need to add the “City list” part to the “Country” page template.
- Edit the “Country” page template.
- Open the Inspect Panel by clicking the cog button in the toolbar.
- Under the Insert tab, click and drag a Part to the page region below the “country” part. (This may be a bit tricky because the “country” part is small.)
- Select the “City list” part from the dropdown in the box. You may need to close the Inspection Panel to see it.
- Save and close the tab.
Now we need to create a few City contents below the countries. (Sample data is available in the table below.)
- From the content pane, select a country content that you created earlier. It is important that each city content is created under the country.
- Right-click the country content and select “New”. The “Create content” dialogue will open.
- Now select “City” from the list of content types.
- Fill in the city name and location; the population is optional. The location format must be comma separated latitude and longitude with decimals.
- Save draft.
- Create several more city contents below each country content by repeating the previous steps. Sample data is provided in the table below.
Each country page will now have a list of the cities you created with a Google map of the location. It should look something like this: