'Add Section if url is shop
I am working on my website but I am using some common templates on the website For any Page that starts with the shop I want to add an HTML section there on how can I do it on the URL basis if the page URL is shop then the section will appear only
Solution 1:[1]
You can get the Craft URL segments and then manage them with an if the condition.
`{% set pageUrl = craft.app.request.pathinfo %}
{% if pageUrl == "shop" %}
{% endif %}`
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Dotsquares |
