Plasmic’s Newsletter

Share this post

Dynamic pages and routes

plasmic.substack.com

Dynamic pages and routes

Team Plasmic
Sep 1, 2022
7
Share this post

Dynamic pages and routes

plasmic.substack.com

You can now create dynamic pages and routes directly in Plasmic Studio.

This means that you can create a single page template that serves many different routes, such as a product details page for each product at /products/[slug], or a blog post page for every blog post at /posts/[slug]. This was possible to do before with Plasmic, but required some additional code to be written each time.

Check out a simple example of this in action, as we build a product details page linked from a product listings page:

Access the route parameters using dynamic values. Use this together with data fetching components to indicate what data to show.

This includes the ability to do set page SEO metadata, using query parameters such as UTM parameters, and more.

To make this work in your codebase, update your use of PlasmicRootProvider to specify pageParams—see for instance the updated Next.js quickstart. If you render using on-demand incremental static generation, server-side rendering, or client-side rendering, then no additional code is needed. Learn more in our docs.

We have more on the way for dynamic pages—tell us what you think in the meantime!

Log back into Plasmic

Share this post

Dynamic pages and routes

plasmic.substack.com
Comments
TopNew

No posts

Ready for more?

© 2023 Plasmic
Privacy ∙ Terms ∙ Collection notice
Start WritingGet the app
Substack is the home for great writing