profound-logoProfound CMS
⌘K
Admin
Theme
DocsGuidaBlogPhilosophy
DocsGuidaBlogPhilosophy

Hybrid

Instradamento parametricoTypes of ComponentsSetup server sent events (SSE) content refetchInstall Profound CMS as a proxyCEL Scripting in Template BuilderProject ScaffoldingMedia Library

Senza testa

Guida rapidaSplit Screen JSON Component Builder with LLMComponent Zod Pull

REST API

REST API OverviewgetConnect your websitegetGET /routesgetOttieni percorsogetGET /blocksgetGET /blocks/with-cel-cachegetGET /blocks/generatedgetGET /componentsgetGET /components/{name}getGET /dataset/{schema_name}getGET /content-changes (SSE)patchPATCH /dataset/{schema_name}postPOST /translationpatchPATCH /translationsgetGET /usagepostPOST /csvpatchPATCH /csv
All Systems Operational
Powered Byprofound-logo
Theme

Setup server sent events (SSE) content refetch

Questa funzionalità ti consente di eseguire nuovamente il rendering delle pagine il cui contenuto è stato modificato nel “Pannello di amministrazione”

Questa funzionalità ti consente di eseguire nuovamente il rendering delle pagine il cui contenuto è stato modificato nel “Pannello di amministrazione”.

Per impostazione predefinita, le pagine vengono fornite come versioni statiche.

  1. Utilizza la versione più recente del nostro renderer.
  2. Questo utilizza gli eventi inviati dal server (SSE) per rilevare le modifiche alle entità pertinenti del database.

Modificheremo il nostro file layout.tsx.

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

// funzione da eseguire durante la rivalidazione
async function revalidate() {
  'use server';
  revalidatePath('/', 'layout'); // ricalcola la cache per queste pagine
}

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 // inserisci le credenziali corrette
          websiteId={"..."}
          cmsUrl={"..."}
          apiKey={"..."}
          
        />
        {children}
      </body>
    </html>
  );
}

Dopo aver modificato il layout principale, puoi modificare i campi nel database e vedere gli aggiornamenti dopo aver ricaricato la pagina.

Continue Reading
Previous‹Types of ComponentsNextInstall Profound CMS as a proxy›