# How can you tell that you're on a collection page

**URL:** <https://talk.jekyllrb.com/t/how-can-you-tell-that-youre-on-a-collection-page/3152>\
**Category:** Help\
**Created:** [July 31, 2019, 3:50pm UTC](https://talk.jekyllrb.com/t/how-can-you-tell-that-youre-on-a-collection-page/3152 "2019-07-31T15:50:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![k16e](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/k16e/32/1694_2.png) [@k16e](https://talk.jekyllrb.com/u/k16e)\
**Post date:** [July 31, 2019, 3:50pm UTC](https://talk.jekyllrb.com/t/how-can-you-tell-that-youre-on-a-collection-page/3152/1 "2019-07-31T15:50:47Z")

</div>

Hey here, does anyone know how to tell when you’re on a collection page?

```auto
{%- if page.layout -%}
    {%- assign class = page.layout -%}
{%- endif -%}
<html lang="en" class="is-{{ class }}">

```

So, I have that, with which I can have a unique class for every unique page, right. Now, I have a couple collections and I wanna be able to assign and use a class of `is-archive` when I’m on the collection reel, but `is-single` when I’m on the single page from a collection. Understood?

Can anyone tell. Thanks.

---

<div class="post-metadata">

**Author:** ![rdyar](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/rdyar/32/710_2.png) [@rdyar](https://talk.jekyllrb.com/u/rdyar)\
**Post date:** [July 31, 2019, 4:30pm UTC](https://talk.jekyllrb.com/t/how-can-you-tell-that-youre-on-a-collection-page/3152/2 "2019-07-31T16:30:34Z")

</div>

whats a collection reel? a list of collection items?

collection label should give you the name of the collection?

> **[Collections](https://jekyllrb.com/docs/collections/#liquid-attributes)**
>
> Collections are a great way to group related content like members of a team or talks at a conference.

---

<div class="post-metadata">

**Author:** ![k16e](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/k16e/32/1694_2.png) [@k16e](https://talk.jekyllrb.com/u/k16e)\
**Post date:** [August 1, 2019, 9:33am UTC](https://talk.jekyllrb.com/t/how-can-you-tell-that-youre-on-a-collection-page/3152/3 "2019-08-01T09:33:50Z")

</div>

Reel, I just meant archive, meaning the page used to render/show all the posts belonging in a collection. Say you have a `posts` collection. How do you tell with Jekyll/Liquid when you’re on a page, a blog page, for example…I’m not sure there’s any variable to do so…

---

<div class="post-metadata">

**Author:** ![rdyar](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/rdyar/32/710_2.png) [@rdyar](https://talk.jekyllrb.com/u/rdyar)\
**Post date:** [August 1, 2019, 3:56pm UTC](https://talk.jekyllrb.com/t/how-can-you-tell-that-youre-on-a-collection-page/3152/4 "2019-08-01T15:56:01Z")

</div>

you can always use your own front matter variable - like `pagetype: reel` and then check for that.

---

<div class="post-metadata">

**Author:** ![k16e](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/k16e/32/1694_2.png) [@k16e](https://talk.jekyllrb.com/u/k16e)\
**Post date:** [August 1, 2019, 4:09pm UTC](https://talk.jekyllrb.com/t/how-can-you-tell-that-youre-on-a-collection-page/3152/5 "2019-08-01T16:09:53Z")

</div>

O, yeah, @rdyar, that’s exactly what I did. Thanks for following up on this.
