Skip to content
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

[Feature Request] Helper method to check if we're on the home page #4993

Closed
benface opened this issue Sep 25, 2019 · 1 comment
Closed

[Feature Request] Helper method to check if we're on the home page #4993

benface opened this issue Sep 25, 2019 · 1 comment

Comments

@benface
Copy link
Contributor

benface commented Sep 25, 2019

Right now we can check if entry.uri is empty, but it would be helpful to have a craft.request.isHome helper.

@brandonkelly
Copy link
Member

I wouldn’t say that being on the homepage is a property of the request. There is no homepage, even if you access /, if you’re running Headless Mode for example. I did just add a getisHomepage() method to elements though, so you could start doing

{% if entry.isHomepage ?? false %}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants