Travelling agency site: Create the Country page

This page displays detailed information for a specific country. It also displays a list of cities and a list of festivals in the current country.

Display detail information about country

You can display detailed information about a country by dropping the Countries widget on the page and configuring the widget to display only country details.
To do that, select the One particular country only... and do not select specific country. This way the Countries widget displays only the detail view of the currently navigated in URL country. For example ~/country/united-states-of-america.

You must set the Details item template of the Countries widget to My Vacation - Full country content template.
The template shows some information about the country, a landscape image of it, and an option to view where on the map the country is located. 

The following screenshot shows the display of Countries widget:

travelling agency5

Use the following markup for My Vacation - Full country content template:

Display all cities in current country 

You can display child items by filtering by parent item. If you want to display all Cities and Festivals in the currently opened country, you can drop both Cities and Festivals widgets and configure them to display cities From the currently open country

To display all items in a horizontal list, you can set the following templates: My vacation - List of Cities - Horizontal for the list of cities and My vacation - List of festivals - Horizontal for the list of festivals. You must also set the details item page for each widget to be City and Festival page, respectively.
For more information how to filter child items with parent items from multiple levels, see Display hierarchy of content items.

The following screenshot shows the display of the Cities and Festivals widgets:

travelling agency6 

Use the following markup for My vacation - List of Cities – Horizontal template:

Use the following markup for My vacation - List of festivals – Horizontal template:

Display list of most popular hotels in country 

To do this, drop the Hotels widget and set the list view widget template to My vacation - List of hotels - With Thumbnail template. This is the same template that you used for displaying popular hotels on the Home page. On this page, however, you need to display only hotels for the currently opened country. 

Note that Hotel type is child of City type, which is child of the Country type and we want to filter hotels by currently opened country (grandparent). Perform the following:

  1. Enable the filtering by parent option in the widget designer by setting the From the currently open city option.
  2. Go to Advanced settings and in field FilterParentTypeName, enter the type name of the Country type - Telerik.Sitefinity.DynamicTypes.Model.TravellingAgency.Country.
    This will enable the hotels widget to filter its content by parent item from type Country.
  3. Apply filtering by tag popular.

The following screenshot shows the display of Hotels widget:

travelling agency7

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Web Security for Sitefinity Administrators

The free standalone Web Security lesson teaches administrators how to protect your websites and Sitefinity instance from external threats. Learn to configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?