profound-logoProfound CMS
⌘K
Admin
Theme
DocsTutorialBlogPhilosophy
DocsTutorialBlogPhilosophy

Hybrid

Parametriskā maršrutēšanaKomponentu veidiSetup server sent events (SSE) content refetchIestatīt administratora paneļa starpniekserveriSkriptēšana veidņu veidotājāProject ScaffoldingMultivides bibliotēka

Headless

Ātrā uzsākšanaSplit Screen JSON Component Builder with LLMComponent Zod Pull

REST API

REST API OverviewgetConnect your websitegetSaņemt maršrutusgetGET /routegetGET /blocksgetGET /blocks/with-cel-cachegetGET /blocks/generatedgetGET /componentsgetGET /components/{name}getGET /dataset/{schema_name}getGET /content-changes (SSE)patchPATCH /dataset/{schema_name}postPēctulkošanapatchTulkojumu labojumigetGET /usagepostPOST /csvpatchPATCH /csv
All Systems Operational
Powered Byprofound-logo
Theme

Setup server sent events (SSE) content refetch

Šī funkcija ļauj atkārtoti renderēt lapas, kuru saturs ir mainījies “Administrēšanas panelī”

Šī funkcija ļauj atkārtoti renderēt lapas, kuru saturs tika mainīts “Administrēšanas panelī”.

Pēc noklusējuma lapas tiek pasniegtas kā statiskas versijas.

  1. Izmantojam mūsu renderētāja jaunāko versiju.
  2. Tas izmanto servera sūtītos notikumus (SSE), lai noteiktu izmaiņas attiecīgajās datubāzes vienībās.

Mēs modificēsim savu failu layout.tsx.

import { Refresher } from 'cms-renderer/lib/refresher';
import { revalidatePath } from 'next/cache';

// funkcija, kas jāpalaiž pārvērtēšanas laikā
async function revalidate() {
  'use server';
  revalidatePath('/', 'layout'); // pārrēķina šo lapu kešu
}

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  return (
    <html lang="en">
      <body className="min-h-screen bg-bg-base text-text-primary antialiased">
        <Refresher // ievadiet pareizos akreditācijas datus
          websiteId={"..."}
          cmsUrl={"..."}
          apiKey={"..."}
          
        />
        {children}
      </body>
    </html>
  );
}

Pēc saknes izkārtojuma izmaiņām varat rediģēt datubāzes laukus un, atsvaidzinot lapu, redzēt atjauninājumus.

Continue Reading
Previous‹Komponentu veidiNextIestatīt administratora paneļa starpniekserveri›