Almost EVERYONE who tried headless systems said they saw benefits. Download the state of CMS now!

Storyblok now on AWS Marketplace: Read more

O’Reilly Report: Decoupled Applications and Composable Web Architectures - Download Now

Empower your teams & get a 582% ROI: See Storyblok's CMS in action

Skip to main content
Browse apps
Install

Requires Business plan

Author
Storyblok GmbH
Last update
7/19/2023
Advanced paths
Programmable preview paths
Advanced paths

When installing this app you get a new field in the folder dialog which lets you define the "Real path". Be aware that this will change the preview path of all your existing content items and you need to define the "Real path" for every folder manually.

The "Real path" is the path where the visual preview points to.

The app has been made for following scenarios:

  • You have root folders that should point to different preview domains
  • You have different preview domains based on the selected language
  • You have a url structure that uses other separators than slashes. Example: yoursite.com/folderxy-itemxy instead of yoursite.com/folderxy/itemxy
  • You have virtual folders. Example: yoursite.com/itemxy instead of yoursite.com/folderxy/itemxy

Templating syntax

The "Real path" is programmable with the templating engine Squirelly and following context is available:

Attention: The folder context variable is only available in the real path of the folder and not on the real path of the story.

  • story The object of the current
  • lang The currently selected language
  • branch_id The current branch id
  • env_location The current environment location
  • env_name The current environment name
  • folder The object of the folder of the path (ONLY available on the folder real path)

Following a few path template examples:

Use https://www.yoursite.de/ when the language is "de" and otherwise use https://www.yoursite.com/{{lang}}

{{if(options.lang == 'de')}}https://www.yoursite.de/{{#else}}https://www.yoursite.com/{{lang}}{{/if}}

Use the folder slug as "Real path"

{{folder.slug}} or {{folder.translated_slug}}

Use a custom preview url only when the environment is not "Default".

{{if(options.env_name == 'Default')}}https://www.yoursite.com/{{/if}}