This page displays detailed information for a specific city. Hotels and restaurant suggestions are listed as well. In addition, it displays information about other places in the country of the current city
You can display detailed information about a city by dropping the Cities widget on the page and configuring it to display only city details. In order to do that, select the One particular city only... option and do not select a specific city. This way, the cities widget displays only details view of the currently navigated in URL city. For example, ~/city/united-states-of-america/new-york. You also set the Details item template of the cities widget to My vacation - Full city content template.
The following screenshot shows the display of Cities widget:
Use the following markup for My vacation - Full city content template:
NOTE: Hotels and Restaurants pages must contain Hotels and Restaurants widgets that are configured to display items from currently opened City.
Hotels are direct children of the currently opened in the URL item (city) and you can display them by dropping the Hotels widget on the page, and configuring it to display hotels From the currently open city. In addition, you need to set details page for the hotels to be the Hotel page. As list item template, select My vacation - List of hotels - Thumbnail And All hotels Link.
The following screenshot shows the display of Hotels widget:
Use the following markup for List of hotels - Thumbnail And All hotels Link template:
Restaurants are direct children of a City. This means that you can apply the same configuration as for the Hotels widget above. For displaying restaurants list, you use the My vacation - List of restaurants - Thumbnail and All restaurants Link template.
The following screenshot shows the display of Restaurants widget:
Use the following markup for My vacation - List of restaurants - Thumbnail and All restaurants Link template:
When you are in a specific city, you may want to display additional information about the country that may be interesting for the users. Displaying information about the current country of the displayed city means displaying information about the parent item – Country.
To show information about the cities and festivals in a country you can drop the Countries widget, and configure it in the following way:
The following screenshot shows the display of Countries widget:
Configuring the countries widget in this way, gives you the ability to easily display information about it in the widget template. For example, showing cities and festivals requires only two Eval methods and two repeaters. Use the following markup for My Vacation - More in Country (List of cities and festivals) template:
To display all cities from a country, you can use the auto generated property Cities to access all child items. When child type is added to the module structure, Sitefinity CMS generates automatically property descriptors for each child type and enables you to get all child items an Eval statement.
You can display all Festivals in the same way.
Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.
This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.
This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.
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.
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important