Create new custom table country names in kentico
Here are the steps to create a new custom table with country names in Kentico:
Step 1: Create a new table
- Log in to your Kentico instance and go to the "Development" section.
- Click on "Tables" and then click on "Create new table".
- Fill in the required information:
- Table name: e.g. "Country"
- Table description: e.g. "List of countries"
- Table type: "Custom table"
- Click "Create" to create the new table.
Step 2: Add columns to the table
- In the "Table" section, click on the "Columns" tab.
- Click on "Add column" and add the following columns:
- Column name: "CountryID" (unique identifier for each country)
- Data type: "Integer"
- Column name: "CountryName" (name of the country)
- Data type: "String"
- Column name: "CountryCode" (ISO 3166-1 alpha-2 code for the country)
- Data type: "String"
- Click "Save" to save the changes.
Step 3: Add data to the table
- In the "Table" section, click on the "Data" tab.
- Click on "Add new record" and add the following data:
- CountryID: 1
- CountryName: "United States"
- CountryCode: "US"
- Repeat the process to add more countries to the table.
Step 4: Create a new module
- In the "Development" section, click on "Modules" and then click on "Create new module".
- Fill in the required information:
- Module name: e.g. "Country"
- Module description: e.g. "Country module"
- Click "Create" to create the new module.
Step 5: Add a new web part to the module
- In the "Modules" section, click on the "Web parts" tab.
- Click on "Add new web part" and select "Custom web part".
- Fill in the required information:
- Web part name: e.g. "Country list"
- Web part description: e.g. "List of countries"
- Click "Create" to create the new web part.
Step 6: Configure the web part
- In the "Web parts" section, click on the "Configure" tab.
- In the "Data source" section, select "Country" as the table.
- In the "Columns" section, select "CountryName" and "CountryCode" as the columns to display.
- Click "Save" to save the changes.
Step 7: Add the web part to a page
- Go to the "Pages" section and select a page where you want to add the web part.
- Click on "Add web part" and select the "Country list" web part.
- Configure the web part as needed (e.g. set the layout, add a title, etc.).
- Click "Save" to save the changes.
That's it! You have now created a new custom table with country names in Kentico and added a web part to display the list of countries.