%baseURL% inside of a partial
The steps in this report use Total CMS Admin Core stack. This stack uses the
%baseURL% macro inside of an each scoped JS template.
- Create a new project w/ Stacks page.
- Enter a valid URL into the website URL in the project General Settings.
- Add Total CMS admin core stack to the page.
- Make the stack a partial.
- Preview the page, you should see no content.
- Save the project to disk and close project.
- Reopen the project.
- Preview the page you will see an error about the website settings not being set properly.
The reason is that when we reopen the project, the
%baseURL% macro returns a nothing.
You can look at the following line inside of source of the published JS within preview...
stacks.totalcms.baseurl = '%baseURL%/'.replace(/\/\/$/,'/');
You can get Total CMS here... https://weavers.link/total-cms-stacks