Closed mvolpato closed 3 years ago
On a similar note, I am using multiple sites. My secondary site is in a subfolder sitename.com/en
.
The en
is evaluated in antlers as segment_1
.
For instance
/en/solution/retail/
is wrong: <body class="template-long_page page-en-solutions">
This is instead correct in the dynamic version of the website.
I am not sure this is related to the issue above. Let me know if not, I will create a new issue.
Update:
{{ current_uri | segment:X }}
seems to work, so I use now {{ current_uri | segment:2 }}
instead of {{ segment_2 }}
.
About the multisite part, I am not even trying before this other issue is fixed, because without that issue fixed multisite does not work at all.
I have a website that I just migrated from Statamic 2 to Statamic 3 and I am trying to generate a static version of it. The css classes of
body
depend on the segments of the URL.In
layout.antlers.html
:The website works well, before generating static code:
/solutions/retail/
:<body class="template-long_page page-solutions-retail">
/subscribed/
:<body class="template-empty page-subscribed">
/work/
:<body class="template-long_page page-work">
In the generated website:
/solutions/retail/
is correct:<body class="template-long_page page-solutions-retail">
/subscribed/
is wrong:<body class="template-empty page-subscribed-retail">
/work/
is wrong:<body class="template-long_page page-work-retail">
Notice the extra
-retail
in the class attribute.In the logs I can see that
subscribed
andwork
are generated right aftersolutions/retail
, so my guess is thatsegment_2
has leaked to the next pages: