-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
content_for_layout rendered before section group #476
Comments
Unfortunately, the ruby code that defines the order doesn't have the same luxury we have in theme-tools. They don't have a HTML+Liquid AST to play with. I suspect they use some form of regex to find the order. This can be solved by rewriting the section like this: {%- sections 'header-group' %}
{%- liquid
# Automatically add microdata to the HTML element if the content contains the section with the class 'section--faq-sections'
if content_for_layout contains 'section--faq-sections'
assign microdata = 'itemscope itemtype="https://schema.org/FAQPage"'
endif
-%}
<main {{ microdata }}>
{{ content_for_layout }}
</main> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
content_for_layout
is rendered before the section group if you do a check for something inside. In the source below you can see that I only check for something in thecontent_for_layout
, but somehow it's also put above the actual group in the theme editor. In the frontend itself it renders at the right positionSource
Expected behaviour
Render the
content_for_layout
at the right position in the theme editor and not where I've added an if statement.Actual behaviour
It renders the
content_for_layout
in the theme editor at the position where the if statement is placed.Debugging information
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: