Create the Hotel and the Restaurant pages

These pages display detailed information about a specific hotel or restaurant. In addition, it gives suggestions about visiting other places in same city – restaurants or hotels. 

NOTE: Hotels and restaurants content types have similar structure and both hotel and restaurant pages are identical in design, so the tutorial guides you only through the creation of the Hotels page and you can create the other is in similar manner. 

Display the detail information about a city 

You can display detailed information about a hotel by dropping the Hotels widget on the page and configuring it to display only hotel’s details.

To do this, select the One particular hotel only... and do not select a specific hotel. This way, the hotels widget displays only details view of the currently navigated in URL hotel. For example ~/ hotel/united-states-of-america/new-york/the-edison-hotel. You also set the Details item template of the hotels widget to My Vacation - Full hotel content template.

The following screenshot shows the display of Hotels widget:

travelling agency12

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

To display information about the city (parent item) and the country (grandparent) of the currently displayed hotel, you can use chain Eval of ParentItem property like this: 

<%# Eval("ParentItem.ParentItem.Name") %> / <%# Eval("ParentItem.Name") %>

Display information about the parent item in the child template 

When you need to have more contextual information about the parent item, for example, a label See also Restaurants in New York, or display child items of the parent item from another type, you can extend the detail template of the hotel item.

The following screenshot shows the display of Hotels widget:

travelling agency13

This can be achieved by adding the following code to the template:

Want to learn more?

Sign up for our free beginner training. Boost your credentials through advanced courses and certification.
Register for Sitefinity training and certification.

Was this article helpful?