Skip to main content
Fix for pages with a defined entry
Source Link
Simon Kuran
  • 3k
  • 1
  • 19
  • 35

You can check a specific URL segment. For example if you need to load some CSS on the About page and that URL is yoursite.com/about you can do this:

{% if craft.app.request.segments|first == 'about' %}
    {# Load CSS #}
{% endif %}

You could also check by entry.id

{% if entry is defined and entry.id == '123' %}
    {# Load CSS #}
{% endif %}

Replace "123" with the id of the entry you'd like to load the CSS for.

You can check a specific URL segment. For example if you need to load some CSS on the About page and that URL is yoursite.com/about you can do this:

{% if craft.app.request.segments|first == 'about' %}
    {# Load CSS #}
{% endif %}

You could also check by entry.id

{% if entry.id == '123' %}
    {# Load CSS #}
{% endif %}

Replace "123" with the id of the entry you'd like to load the CSS for.

You can check a specific URL segment. For example if you need to load some CSS on the About page and that URL is yoursite.com/about you can do this:

{% if craft.app.request.segments|first == 'about' %}
    {# Load CSS #}
{% endif %}

You could also check by entry.id

{% if entry is defined and entry.id == '123' %}
    {# Load CSS #}
{% endif %}

Replace "123" with the id of the entry you'd like to load the CSS for.

Fix typo
Source Link
Simon Kuran
  • 3k
  • 1
  • 19
  • 35

You can check a specific URL segment. For example if you need to load some CSS on the About page and that URL is yoursite.com/about you can do this:

{% if craft.app.request.segments|first == 'about' %}
    {# Load CSS #}
{% endif %}

You could also check by entry.id

{% if entry.id == '123' %}
    {# Load CSS #}
{% endif %}

Replace "123" withewith the id of the entry you'd like to load the CSS for.

You can check a specific URL segment. For example if you need to load some CSS on the About page and that URL is yoursite.com/about you can do this:

{% if craft.app.request.segments|first == 'about' %}
    {# Load CSS #}
{% endif %}

You could also check by entry.id

{% if entry.id == '123' %}
    {# Load CSS #}
{% endif %}

Replace "123" withe the id of the entry you'd like to load the CSS for.

You can check a specific URL segment. For example if you need to load some CSS on the About page and that URL is yoursite.com/about you can do this:

{% if craft.app.request.segments|first == 'about' %}
    {# Load CSS #}
{% endif %}

You could also check by entry.id

{% if entry.id == '123' %}
    {# Load CSS #}
{% endif %}

Replace "123" with the id of the entry you'd like to load the CSS for.

Source Link
Simon Kuran
  • 3k
  • 1
  • 19
  • 35

You can check a specific URL segment. For example if you need to load some CSS on the About page and that URL is yoursite.com/about you can do this:

{% if craft.app.request.segments|first == 'about' %}
    {# Load CSS #}
{% endif %}

You could also check by entry.id

{% if entry.id == '123' %}
    {# Load CSS #}
{% endif %}

Replace "123" withe the id of the entry you'd like to load the CSS for.