Join the Webstudio community

Updated 6 months ago

CMS: Dynamic Variables on parts of a page without different slugs?

At a glance

The community members are discussing how to personalize a standard page on a SaaS site using CRM or referrer data, without generating a dynamic page with a unique slug. The first community member suggests using query parameters and system variables to customize the content, such as the heading. The second community member has a follow-up question about creating dynamic versions of baseline pages, with the ability to redirect to the baseline page if the dynamic version doesn't exist. The community members discuss the potential issues with slow page loads and the flash of unstyled text, and the second community member prefers pre-built custom pages over customizing a persistent page. There is no explicitly marked answer in the comments.

Useful resources
More questions:

If I'm using CRM or referrer data to personalize a standard page on a SaaS site (e.g. home or /product) and only want to change the text of a few elements (e.g. the headlines/subheads and the testimonials shown), is there a way to do this with the CMS features with only URL paramaters / without generating a dynamic page with a unique page slug?

So it stays "https://sitename.com/product?prospect_name=X?company_name=Y OR /product?source=tik_tok?etc (rather than /product/tik_tok_campaignX)
J
E
6 comments
Yes the query params are made available in the system variables so you can use those values within your content https://docs.webstudio.is/university/foundations/variables#system
for example for a heading you can do Hello, ${system.search.prospect_name} and the variable's value would be X in your example
thanks @John Siciliano! I have a follow up question about dynamic pages and variables.

Scenario:
  • I have baseline static pages (e.g. /productX and /productx/detail-page)
  • I want to use a dynamic version of specific baseline pages that I use to create N number of personalized versions of that baseline page
  • I want the dynamic version to exist at /baseline-version/{customized-version-slug}
  • eg. /productx/{custom-slug} or productx/detail-page/{customized-version-slug}
  • AND if there is no dynamic version at /page/{customized-version-slug} to automatically redirect back to the correct baseline page rather than a 404 page
I'm open to a simpler approach that gets the same outcome. My concern about variables instead of dynamic pages:

  • The flash of unstyled text or slow page loads if the CRM API is slow
  • For my use case, pre-built custom pages at specific urls makes more sense than customizing a persistent page.
Thanks to your excellent tutorial videos, I've figured out how to create dynamic pages even though I know little about code, but the above is beyond my level.
The flash of unstyled text or slow page loads if the CRM API is slow
the page doesnt load until all the resources have been fetched so there wont be any flash. it can be slow however if your apis are slow

my understanding is you want to redirect visitors if they go to a dynamic page with a value that doesnt exist? you can use the dynamic redirect field. And do something like data.value.somevalue ? '' : '/mystaticpage'
Idk the use case, but seems odd not to 404 but to redirect πŸ€·β€β™‚οΈ
Add a reply
Sign up and join the conversation on Discord