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 currentlang
The currently selected languagebranch_id
The current branch idenv_location
The current environment locationenv_name
The current environment namefolder
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}}