What are you trying to do? (please be as specific as possible and include relevant screenshots, code snippets)
I am trying to create a dynamic page (e.g., /blog/[id]) in my project using the Plasmic CMS as the data source.
I already have a CMS set up in my workspace and I can create and manage articles without issues.
However, when I try to create a dynamic page, Plasmic only offers me external integrations (Airtable, GraphQL, etc.) and does not let me select my Plasmic CMS as the integration source.
I need to create a dynamic page template that is connected to my CMS so it works with Next.js.
What are the reproduction steps?
- Go to my workspace and open the project.
- Try to create a new dynamic page (Pages > + New Page > Dynamic Page).
- Notice that only external integrations are available, and the Plasmic CMS does not appear as an option.
- I have tried refreshing, logging out/in, and using different browsers, but the issue persists.
Relevant links:
Screenshots
Hi @lucas_cerliani, the dynamic pages modal is just a helper for backend integrations—you’ll need to manually set up dynamic pages when using Plasmic CMS.
You can define route parameters through the Page Settings, and then map the param to the CMS Data Fetcher to fetch the correct entry.
Hope that makes sense—let me know if you have any questions!
Hi @abbas_nazar! Thank you very much for the response. I made the corresponding changes for setting up the dynamic page manually. I’m integrating Plasmic with Next.js, for some reason when fetching the pages, I’m getting al the pages correctly but this one with the route parameter is not fetching, any idea on what is going on?
Thanks in advance!
Hi @lucas_cerliani, I think something might’ve been missed. I just double-checked and would like to suggest following these steps to ensure everything is set up correctly:
- Create a project in Plasmic
- Add a regular page and a dynamic page (with a slug or ID)
- Set up a Next.js project and sync your Plasmic project with it
- At this point, it should be able to fetch both the static and dynamic pages
Let me know if anything’s unclear or if you run into any issues.
Hi @abbas_nazar, thank you again for your answer. I just tried what you told me, I created a new project and created two new pages, a normal page (NewPage) and a dynamic page (Test), when using the plasmic method to retrieve the pages, I’m only getting the normal page and not the dynamic, I attach you the image of my pages created in Plasmic.
Thanks again for your concern!
Hi @lucas_cerliani, just to confirm—are you running the project locally and viewing the page in the browser? The doc you shared appears to be for a loader-based setup, but if you’re trying to access the code, you might need to use a codegen project instead.
Hi @abbas_nazar, yes, I am running the project locally and viewing the page in the browser using the Plasmic Loader integration for Next.js (not codegen). My setup is loader-based, and I’m fetching pages with PLASMIC.fetchPages(). The dynamic page (with a path like /test/[id]) does not appear in the array of pages, only the static ones do.
My main issue is that dynamic pages (with [id] in the path) are not returned by the loader’s fetchPages() method, so I cannot render them in Next.js. Is this expected? Is there a workaround to get dynamic pages with the loader setup?
Thanks in advance!
Hi @lucas_cerliani, thanks for the clarification! To fetch dynamic pages, you can pass the includeDynamicPages
option like this: fetchPages({ includeDynamicPages: true })
. Hope that helps!