---
title: 'Active Page If page:1?'
url: 'https://getgrav.org/forum/archive/active-page-if-page-1-t1682'
markdown: 'https://getgrav.org/forum/archive/active-page-if-page-1-t1682.md'
date: '2026-06-21'
description: "% set current_page = (p.active or p.activeChild) ? 'active' : '' %} does not set the current_page to active if the page is of the form blog/page:1 The"
---

[Archive](https://getgrav.org/forum/archive)

#  Active Page If page:1? 

  Started by Muut Archive 12 years ago · 8 replies · 680 views    

 [12 years ago](https://getgrav.org/forum/archive/active-page-if-page-1-t1682#post-2276 "Permalink") 

`% set current_page = (p.active or p.activeChild) ? 'active' : '' %}` does not set the current\_page to active if the page is of the form `blog/page:1`

The Antimatter theme has this problem, too, but not the main Grav blog.

Does Grav have a test for that case, or should I construct something myself?

 [12 years ago](https://getgrav.org/forum/archive/active-page-if-page-1-t1682#post-2277 "Permalink") 

i can confirm this is a bug if the page with pagination is the home page. I will look into it.

 [12 years ago](https://getgrav.org/forum/archive/active-page-if-page-1-t1682#post-2278 "Permalink") 

Ok, there is a simple fix for this. Edit your `/user/config/site.yaml` and add this:

```yaml
blog:
  route: '' 
```

As there is no `blog.route` set, it's default to `/blog` as provided in the `system/config/site.yaml` and that is why it's adding the /blog in the URL and losing the active state in the menu.

 [12 years ago](https://getgrav.org/forum/archive/active-page-if-page-1-t1682#post-2279 "Permalink") 

That works.

 [12 years ago](https://getgrav.org/forum/archive/active-page-if-page-1-t1682#post-2280 "Permalink") 

I was hoping this would also fix the problem where blog posts are not seen as children to the main blog page, so the blog menu items doesn't get the `active` class. My blog post URLs look like this: `/blog/what-if-photos-is-great`.

Is the `/blog/` part still to blame?

Yep, I cleared my caches. :)

 [12 years ago](https://getgrav.org/forum/archive/active-page-if-page-1-t1682#post-2281 "Permalink") 

Yah, those `base_url` value (current version of Antimatter) is built with `site.blog.route`. And that is defaulting to `/blog` in the `system/config/site.yaml`.

My fix was to override and set this value in your `/user/config/site.yaml`. I tested this and it worked.

I've actually changed Anitmatter for the next release so that this value will no longer be used. It will set `base_url` to `page.url` in `blog.html.twig` and set it to `page.parent.url` in `item.html.twig`. This will ensure you won't need that `site.blog.route` to be provided going forward.

So to summarize, my fix does work, you may of just changed the wrong file, or changed it incorrectly. By changing the config file, it should automatically update the cache.

 [12 years ago](https://getgrav.org/forum/archive/active-page-if-page-1-t1682#post-2282 "Permalink") 

Actually spoke to soon.. Works fine on homepage, but not on an 'item' page. Will look at that again.

 [12 years ago](https://getgrav.org/forum/archive/active-page-if-page-1-t1682#post-2283 "Permalink") 

Ok proper fix will be in 0.9.5 release (tonight?) if i can get my house chores done! :)

 [12 years ago](https://getgrav.org/forum/archive/active-page-if-page-1-t1682#post-2284 "Permalink") 

Released!

[Log in](https://getgrav.org/login?return=%2Fforum%2Farchive%2Factive-page-if-page-1-t1682) to reply.

###  Suggested topics

 | Topic | Participants | Replies | Views | Activity |
|---|---|---|---|---|
| [About the Archive category](https://getgrav.org/forum/archive/about-the-archive-category-t6942)    [Archive](https://getgrav.org/forum/archive) · by Deleted User, 9 years ago |  | 0 | 2941 | [9 years ago](https://getgrav.org/forum/archive/about-the-archive-category-t6942 "by Deleted User") |
| [Hey buddies!](https://getgrav.org/forum/archive/hey-buddies-t643)    [Archive](https://getgrav.org/forum/archive) · by Muut Archive, 9 years ago |  | 2 | 1910 | [9 years ago](https://getgrav.org/forum/archive/hey-buddies-t643 "by Muut Archive") |
| [There is a way to do a "if condition" in MD page?](https://getgrav.org/forum/archive/there-is-a-way-to-do-a-if-condition-in-md-page-t3377)    [Archive](https://getgrav.org/forum/archive) · by Muut Archive, 9 years ago |  | 2 | 5248 | [9 years ago](https://getgrav.org/forum/archive/there-is-a-way-to-do-a-if-condition-in-md-page-t3377 "by Muut Archive") |
| [Official docker image of grav (+admin +gitsync)](https://getgrav.org/forum/archive/official-docker-image-of-grav-admin-gitsync-t8519)    [Archive](https://getgrav.org/forum/archive) · by Muut Archive, 9 years ago |  | 1 | 4064 | [9 years ago](https://getgrav.org/forum/archive/official-docker-image-of-grav-admin-gitsync-t8519 "by Muut Archive") |
| [Weird Grav + caddy + iOS + https problem](https://getgrav.org/forum/archive/weird-grav-caddy-ios-https-problem-t7837)    [Archive](https://getgrav.org/forum/archive) · by Muut Archive, 9 years ago |  | 3 | 2000 | [9 years ago](https://getgrav.org/forum/archive/weird-grav-caddy-ios-https-problem-t7837 "by Muut Archive") |
