X Enterprises
Pages

Restaurant Profile

The /restaurants/:slug layout and overview child — fetches all restaurant data once and provides it to child pages via inject.

Restaurant Profile

The /restaurants/:slug route is a Nuxt layout route (restaurants/[slug].vue) that wraps all restaurant sub-pages. It fetches every data type for the restaurant once using useAsyncData and provides the results via provide/inject to child pages, preventing duplicate API calls. The default child (/restaurants/:slug/) renders the profile overview: about section, promotions, FAQ, and contact details.

Routes

RouteDescription
/restaurants/:slugLayout — data provider, renders hero, breadcrumb, navigation, and sidebar.
/restaurants/:slug/Overview child — about, promotions, FAQ, and contact.

Components Used

ComponentRole
XRDProfileHeroFull-width restaurant hero image with name and rating.
XRDProfileBreadcrumbBreadcrumb navigation back to the listing.
XRDProfileNavigationTab-style sub-navigation (Overview, Menu, Reviews, Photos, Articles).
XRDProfileSidebarSticky sidebar with key info, contact, and map.
XRDProfileCardCompact card used in related restaurants section.
XRDProfileAboutAbout text and highlights section.
XRDProfileDescriptionExtended description block.
XRDProfileContactContact details (phone, email, website).
XRDProfileContactInfoStructured contact info display.
XRDProfileHoursOpening hours table.
XRDProfileMapEmbedded map showing restaurant location.
XRDProfileCuisineCuisine tags display.
XRDProfileDietaryDietary option badges.
XRDProfileAmenitiesAmenities icon list.
XRDProfileSocialSocial media links.
XRDProfilePromotionsCurrent promotions / offers.
XRDProfileNewsletterEmail newsletter signup widget.
XRDProfileFAQRestaurant-specific FAQ accordion.

Data Fetching

The layout calls useRestaurant(slug) and fetches all resources in parallel via useAsyncData:

  • getRestaurant() — profile data
  • getRestaurantSchema() — JSON-LD structured data injected into <head>
  • getRestaurantReviews() — provided to the reviews child page
  • getRestaurantFAQs() — provided to the overview child page
  • getRestaurantMenu() — provided to the menu child page
  • getRestaurantPhotos() — provided to the photos child page

AI Context

route: /restaurants/:slug
package: "@xenterprises/nuxt-x-restaurants"
use-when: >
  Rendering any restaurant profile page. The layout at /restaurants/:slug
  is the data provider for all child routes. Child pages receive data via
  inject rather than fetching independently. The default child at
  /restaurants/:slug/ renders the overview tab.
Copyright © 2026