X Enterprises
Pages

Restaurant Profile

The /restaurants/:slug layout and overview child — fetches the restaurant profile once via useDomain().getRestaurantBySlug() and renders hero, navigation, sidebar, and child route content.

Restaurant Profile

The /restaurants/:slug route is a Nuxt layout route (restaurants/[slug].vue) that wraps all restaurant sub-pages. It fetches the restaurant profile once via useDomain().getRestaurantBySlug() inside useAsyncData, then renders the hero, sticky tab navigation, sidebar, and the active child route. If no restaurant is returned, the layout throws a 404 via createError().

JSON-LD LocalBusiness schema (XSchemaLocalBusiness) is injected automatically — only when restaurant is truthy. The page also emits a page_view analytics event via useAnalytics().trackPageView() on mount.

The default child (/restaurants/:slug/) renders the profile overview: about section, promotions, FAQ, and contact details.

Routes

RouteDescription
/restaurants/:slugLayout — data provider, renders hero, navigation, and sidebar.
/restaurants/:slug/Overview child — about, promotions, FAQ, and contact.
/restaurants/:slug/menuMenu child.
/restaurants/:slug/reviewsReviews child.
/restaurants/:slug/photosPhotos child.
/restaurants/:slug/articlesRelated articles child.

Components Used

ComponentRole
XRDProfileHeroFull-width restaurant hero image with name, rating stars, cuisine, and price.
XRDProfileNavigationSticky tab navigation (Home, Menu, Local Reviews, Photos, Articles).
XRDProfileSidebarSticky sidebar in the right column on desktop.
XRDProfileCardCompact card used in related restaurants sections.
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.
XRDProfileMenuSectionMenu category section.
XRDProfileMenuItemIndividual menu item.
XRDProfileReviewsReviews container.
XRDProfileReviewsItemSingle review item.
XRDProfileSocialSocial media links.
XRDProfilePromotionsCurrent promotions / offers.
XRDProfileNewsletterEmail newsletter signup widget.
XRDProfileFAQRestaurant-specific FAQ accordion.
XRDProfileBreadcrumbBreadcrumb navigation.

Data Fetching

The layout calls useDomain().getRestaurantBySlug(slug) inside useAsyncData, keyed by restaurant-${slug}:

const { data: restaurant } = await useAsyncData<RestaurantApiResponse>(
  `restaurant-${slug.value}`,
  async () => (await domain.getRestaurantBySlug(slug.value)) as RestaurantApiResponse,
)

The restaurant ref is then provide('restaurant', restaurant)'d to child pages so they can read it via inject('restaurant') without re-fetching. Child pages should use this pattern rather than calling useDomain() again.

useSiteMeta({...}) builds SEO meta + OpenGraph + Twitter Card from the restaurant object (metaTitle, metaDescription, description, tagline, coverImage, images[0], slug) in one call.


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 — it calls useDomain().getRestaurantBySlug() once,
  provides the result to children, and emits an analytics page_view event.
  JSON-LD LocalBusiness schema is injected via XSchemaLocalBusiness.
  Child pages should read the restaurant via inject('restaurant') rather
  than re-fetching.
Copyright © 2026