> ## Documentation Index
> Fetch the complete documentation index at: https://weaverse.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Weaverse component configuration uses `settings`. `inspector` is deprecated; never generate it.
> Weaverse Hydrogen themes use React Router v7: import from `react-router`, never `react-router-dom` or `@remix-run/*`.
> Before using any code sample, read `@weaverse/hydrogen` in the project's `package.json`: 6.x and 5.x import from different entries and use different type names, so code for one does not build on the other.
> `@weaverse/hydrogen` 6 (Shopify Hydrogen 2026.10 and later, the version these docs show) imports from `@weaverse/hydrogen/react-router` and uses `Weaverse*` types such as `WeaverseComponentProps`, `WeaverseComponentLoaderArgs` and `WeaverseComponentSchema`; the root `@weaverse/hydrogen` entry only exports `createSchema()`, data helpers and types.
> `@weaverse/hydrogen` 5.x (Hydrogen 2026.4 and earlier) imports everything from `@weaverse/hydrogen` and uses `HydrogenComponentProps`, `ComponentLoaderArgs` and `HydrogenComponentSchema`. On a 5.x project, convert samples to these names. Upgrade to 6 only when asked (`npx @weaverse/cli@latest migrate v6`, plus the Hydrogen 2026.10 upgrade). Do not mix major versions.
> Next.js themes use `@weaverse/hydrogen` 6.2.0 or later: import client and shared code from `@weaverse/hydrogen/next` and server-only code from `@weaverse/hydrogen/next/server`. `@weaverse/next` is deprecated; never install or import it.
> For live project data (pages, theme settings, translations), use the Weaverse MCP server: https://weaverse.io/docs/developer-tools/weaverse-mcp

# Custom Pages

> Create Hydrogen custom pages with Weaverse.

# Custom Pages in Weaverse

Custom pages let you create unique, fully customizable routes for your Hydrogen storefront using Weaverse Studio. Use these pages for landing pages, promotional campaigns, unique content, or anything outside the standard Shopify page types.

> **What are Custom Pages?**
> Custom Pages in Weaverse allow you to define any route and visually build content for it—without code or deployment. Perfect for landing pages, campaigns, or utility content.

***

## Overview

Custom pages empower you to:

* Launch campaign/landing pages without developer deployment
* Build unique content-driven or utility pages (store locator, FAQ, etc.)
* Use Weaverse's drag-and-drop sections for any route you define

## When to Use Custom Pages

* For content or marketing pages not tied to Shopify's built-in page types (product, collection, etc.)
* When you want total layout freedom and section control
* For SEO-optimized, campaign-specific, or seasonal content

> **Tip:** Use clear, descriptive handles for your custom pages (e.g., `/summer-sale`). Handles must be unique and should not conflict with built-in Shopify routes.

***

## Step 1: Creating a Custom Page in Weaverse Studio

1. Open **Weaverse Studio**.
2. Click the **Page navigation dropdown** in the top bar.
3. Select **Create custom page**.
   ![Create custom page](https://cdn.shopify.com/s/files/1/0838/0052/3057/files/create_custom_page.png?v=1724230968)
4. Enter a **name** and **handle** (URL path) for your new page, then click **Create custom page**.
   ![Create custom page 2](https://cdn.shopify.com/s/files/1/0838/0052/3057/files/my_custom_page.png?v=1724231044)
5. The Studio will open your new page, ready for section editing.

> **Warning:** Handles must be unique. If you reuse a handle, it may override an existing page or cause routing conflicts.

***

## Step 2: Configuring Hydrogen Routing

To serve custom pages, you need a catch-all route in your Hydrogen app. This enables dynamic rendering of any custom page defined in Weaverse Studio.

Pilot ships this already — `app/routes/catch-all.tsx`, registered as the last entry inside the `:locale?` block of `app/routes.ts`:

```ts theme={null}
// app/routes.ts
...prefix(":locale?", [
  index("routes/home.tsx"),
  // …all concrete routes…
  route("*", "routes/catch-all.tsx"),
]),
```

> [!NOTE]
>
> Pilot uses React Router 7's manual route registry. Adding a file under `app/routes/` does not create a route — it must be registered in `app/routes.ts`.

### Handling Locales vs. Custom Page Handles

In multilingual storefronts, the first segment of the URL may be a locale (e.g., `/en-us`) or a custom page handle. For a one-segment URL such as `/about`, React Router matches Pilot's index route inside the optional `:locale?` prefix. `routes/home.tsx` checks whether that segment is a supported locale; when it is not, the loader requests a `CUSTOM` page instead of the homepage.

Pilot handles this in `app/utils/locale.ts`: `resolveLocale()` only treats the first path segment as a locale when it matches an entry in `SUPPORTED_LOCALES`; otherwise the default locale is used and the segment stays part of the custom page path. `app/.server/storefront.ts` uses it to build the Storefront client's `i18n` for each request.

> **Best Practice:** Keep your supported-locale list (`SUPPORTED_LOCALES`) as the single source of truth. Anything not in it is a custom page handle — you don't need per-route locale sniffing.

### The Home and Catch-All Routes

Pilot's `app/routes/catch-all.tsx` handles other unmatched paths with `type: "CUSTOM"`. The handle is resolved from the request URL, so no `handle` argument is needed. The home route uses the same page type for an unrecognized one-segment locale parameter:

```tsx theme={null}
// app/routes/catch-all.tsx
import { getWeaverseSeoMeta } from "@weaverse/hydrogen/react-router";
import type { LoaderFunctionArgs, MetaFunction } from "react-router";
import { routeHeaders } from "~/utils/cache";
import { validateWeaverseData, WeaverseContent } from "~/weaverse";

export let headers = routeHeaders;

export async function loader({ context }: LoaderFunctionArgs) {
  const weaverseData = await context.weaverse.loadPage({
    type: "CUSTOM",
  });
  validateWeaverseData(weaverseData);

  return {
    weaverseData,
  };
}

export const meta: MetaFunction<typeof loader> = ({ data }) => {
  return getWeaverseSeoMeta(data?.weaverseData);
};

export default function Component() {
  return <WeaverseContent />;
}
```

#### How it works:

* The loader fetches the custom page matching the current request URL.
* `validateWeaverseData()` throws a 404 when no page is found (and for the fallback page outside design mode). `loadPage()` itself resolves to `null` on failure rather than throwing, so always check the result.
* `getWeaverseSeoMeta()` renders the SEO fields you configured on the page in Studio.
* `<WeaverseContent />` renders the sections.

> [!NOTE]
>
> Route modules are ordinary React Router 7 modules: import `LoaderFunctionArgs` and `MetaFunction` from `react-router`, not from `@shopify/remix-oxygen`, and return plain objects from loaders instead of `json()`.

> **Troubleshooting:** If your custom page is not rendering, check the handle, page publication status, and route setup.

### Dedicated Routes for Specific Custom Pages

Root-level custom pages need no extra route — Pilot's home/catch-all routing already covers them. Register a dedicated route in `app/routes.ts` only when you want a different URL shape (e.g. nesting every campaign under `/promo/...`), and load it with `type: "CUSTOM"` too.

***

## Step 3: Adding Custom Pages to Navigation

1. In Shopify Admin, go to **Online Store > Navigation**.
2. Select your menu and click **Add menu item**.
3. Name the item and set the **Link** to your custom page path (e.g., `/my-custom-page`).
4. Save. Your page is now accessible from your storefront navigation.

> **Tip:** Shopify navigation changes may take a few minutes to appear on your live storefront due to caching.

***

## Step 4: Customizing Your Page

1. In Weaverse Studio, open your custom page.
2. Click **Add Section** to drag in content blocks (banners, products, forms, etc.).
3. Edit and arrange sections as needed. Use settings for layout, colors, and content.
4. Save and preview.

> **Best Practice:** Use global theme settings and reuse global sections for consistent branding across your storefront. Preview changes before publishing to ensure layout and content accuracy.

***

> **Note:** Custom pages created in Weaverse are **not automatically included** in your store's sitemap (e.g., `sitemap.xml`) yet. To ensure they appear in your sitemap for SEO, you need to manually add them in your sitemap route (e.g., `sitemap.$type.$page[.xml].tsx`). Automatic inclusion will be supported in a future release.

***

## Custom Pages with Localization

Custom pages support Weaverse's localization features, allowing you to create locale-specific custom pages for different markets.

### Creating Localized Custom Pages

In Weaverse Studio, you can create localized versions of custom pages using the country selector, just like with other page types. See the [Markets & Localization guide](https://weaverse.io/docs/features/markets-localization.md) for Studio workflow details.

### Loading Localized Custom Pages

#### Auto-Detection (Default)

Custom pages automatically detect the locale from Hydrogen's i18n context:

```tsx theme={null}
// app/routes/catch-all.tsx
export async function loader({ context }: LoaderFunctionArgs) {
  let weaverseData = await context.weaverse.loadPage({
    type: "CUSTOM",
    // locale auto-detected from context.storefront.i18n
  });

  validateWeaverseData(weaverseData);

  return { weaverseData };
}
```

#### Explicit Locale Parameter

For custom routing logic or when you need to explicitly specify the locale:

```tsx theme={null}
// app/routes/about.tsx
export async function loader({ context, request }: LoaderFunctionArgs) {
  let { weaverse } = context;

  // Determine locale from custom logic
  let locale = determineLocaleFromRequest(request);

  let weaverseData = await weaverse.loadPage({
    type: "CUSTOM",
    locale, // Explicitly specify locale
  });

  if (!weaverseData) {
    throw new Response("Page not found", { status: 404 });
  }

  return { weaverseData, locale };
}

function determineLocaleFromRequest(request: Request): string {
  // Custom logic: subdomain, cookie, header, etc.
  let url = new URL(request.url);
  let subdomain = url.hostname.split(".")[0];

  let localeMap: Record<string, string> = {
    "se": "sv-se",
    "fr": "fr-ca",
    "de": "de-de",
  };

  return localeMap[subdomain] || "en-us";
}
```

### Locale-Specific Custom Page Routes

Create dedicated routes for locale-specific custom pages. Register each one in `app/routes.ts` inside the `:locale?` prefix block — for example `route("om-oss", "routes/pages/om-oss.tsx")`:

```tsx theme={null}
// app/routes/pages/om-oss.tsx (Swedish "About Us")
export async function loader({ context }: LoaderFunctionArgs) {
  let weaverseData = await context.weaverse.loadPage({
    type: "CUSTOM",
    locale: "sv-se", // Load Swedish version
  });

  if (!weaverseData) {
    throw new Response("Page not found", { status: 404 });
  }

  return { weaverseData };
}

export default function AboutSe() {
  return <WeaverseContent />;
}
```

```tsx theme={null}
// app/routes/pages/a-propos.tsx (French "About Us")
// Registered as: route("a-propos", "routes/pages/a-propos.tsx")
export async function loader({ context }: LoaderFunctionArgs) {
  let weaverseData = await context.weaverse.loadPage({
    type: "CUSTOM",
    locale: "fr-ca", // Load French Canadian version
  });

  if (!weaverseData) {
    throw new Response("Page not found", { status: 404 });
  }

  return { weaverseData };
}

export default function AboutFr() {
  return <WeaverseContent />;
}
```

### Loading Multiple Locale Versions

For translation workflows or content comparison:

```tsx theme={null}
export async function loader({ context }: LoaderFunctionArgs) {
  let { weaverse } = context;

  // Load same custom page in multiple locales
  let [englishPage, frenchPage, swedishPage] = await Promise.all([
    weaverse.loadPage({ type: "CUSTOM", locale: "en-us" }),
    weaverse.loadPage({ type: "CUSTOM", locale: "fr-ca" }),
    weaverse.loadPage({ type: "CUSTOM", locale: "sv-se" }),
  ]);

  return { englishPage, frenchPage, swedishPage };
}
```

### Multi-Project Custom Pages

For complex multi-market scenarios, use the multi-project approach:

```tsx theme={null}
// app/.server/context.ts
export async function createAppContext(
  request: Request,
  env: Env,
  executionContext: ExecutionContext,
) {
  // …cache, session, storefront and customerAccount setup…

  const weaverse = new WeaverseClient({
    storefront,
    env,
    cache,
    waitUntil,
    request,
    customerAccount,
    themeSchema,
    components,
    projectId: () => {
      let origin = new URL(request.url).origin;

      if (origin === "https://mystore.se") {
        return "project-sweden-123"; // Swedish project with Swedish custom pages
      }
      if (origin === "https://mystore.fr") {
        return "project-france-456"; // French project with French custom pages
      }

      return env.WEAVERSE_PROJECT_ID;
    },
  });

  // `server.ts` copies this plain object onto React Router's context
  return { env, cache, waitUntil, session, storefront, customerAccount, weaverse };
}

// app/routes/pages/about.tsx
// Registered as: route("about", "routes/pages/about.tsx")
export async function loader({ context }: LoaderFunctionArgs) {
  let weaverseData = await context.weaverse.loadPage({
    type: "CUSTOM",
    // projectId automatically determined by domain
    // Each project has its own custom pages
  });

  return { weaverseData };
}
```

**Benefits of multi-project for custom pages:**

* Completely different custom page structure per market
* Independent theme settings and global sections
* Market-specific page routing and navigation
* No shared content between markets

> [!TIP]
>
> See [Advanced Localization Guide](https://weaverse.io/docs/guides/localization-advanced.md) for complete details on locale detection, multi-project architecture, and advanced scenarios.

***

## SEO & Best Practices

* Use descriptive handles (e.g., `/summer-sale`)
* Add meta titles/descriptions in your Hydrogen loader or via Weaverse SEO settings
* Use semantic section blocks for accessibility
* Keep images optimized for fast loading
* Link to [Hydrogen SEO Guide](https://shopify.dev/docs/custom-storefronts/hydrogen/seo)

***

## Troubleshooting

**Page shows 404:**

* Check that the custom page exists in Weaverse Studio and is published
* Ensure the handle matches the route in the URL
* Confirm your Hydrogen catch-all route is set up as above
* **If using locales:** Make sure your loader distinguishes between locale codes and custom handles as shown in the example above.
* Check browser console and network requests for errors

**Sections not showing:**

* Make sure you have added and saved sections in Weaverse Studio
* Refresh your Hydrogen storefront after publishing changes
* Confirm there are no errors in the browser console

**Navigation link not working:**

* Double-check the menu item path in Shopify Admin
* Wait a few minutes for navigation cache to update

**Common Mistakes:**

* Reusing a handle that conflicts with built-in Shopify routes
* Not publishing the custom page in Weaverse Studio
* Forgetting to update Hydrogen routes after adding new custom pages

***

## Advanced Examples

### Example 1: Promotional Landing Page

* Create a new custom page `/black-friday`
* Add hero banners, product grids, countdown timers
* Link from your homepage or ads

### Example 2: Custom Store Locator

* Create `/store-locator`
* Add a map section and store info blocks
* Use custom code or embed a map widget if needed

### Example 3: Dynamic Content Page

* Use loader to fetch dynamic data (e.g., from a CMS or API)
* Render with WeaverseContent and pass data as props

```tsx theme={null}
// Example: Fetching CMS data in loader
export async function loader({ context }: LoaderFunctionArgs) {
  const cmsData = await fetch('https://api.example.com/content').then(res => res.json());
  const weaverseData = await context.weaverse.loadPage({ type: "CUSTOM" });
  return { weaverseData, cmsData };
}

export default function CustomPage({ weaverseData, cmsData }: { weaverseData: any; cmsData: any }) {
  return (
    <>
      <WeaverseContent {...weaverseData} />
      <section>{cmsData.title}</section>
    </>
  );
}
```

### Example 4: Integrating with External APIs

* Fetch data from a third-party API in your loader and merge it with Weaverse content as shown above.

***

## Next Steps & Resources

* For multi-market or multi-brand custom pages, see [Multi-Project Architecture Guide](https://weaverse.io/docs/guides/multi-project-architecture.md)
* Explore [Weaverse Documentation](https://weaverse.io/docs/index.md)
* Learn more about [Hydrogen Routing](https://shopify.dev/docs/custom-storefronts/hydrogen/routing)
* Review [Shopify Navigation](https://help.shopify.com/manual/online-store/menus-and-links)
* For advanced customization, see [Weaverse SDK](https://weaverse.io/docs/developer-tools/weaverse-sdks.md)

With this setup, your Hydrogen storefront can host any number of flexible, SEO-friendly, and fully branded custom pages—no deployment required. Enjoy building with Weaverse!


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.