Check if I'm on the startpage, add class


I'm trying to solve a small issue where I would like to add class depending on if I'm on the startpage (page: startpage) or not. I think it's pretty simple but I'm still struggling with learning.

I'm thinking I should probably do something like this?

<div :class="{'-start-page': this.??? === true}">

Anyone's got an idea?

Hi @orjan ,

To do this I wouldn't set a conditional on which page is being used. I would use variations to allow the author to set the different styles on the Slice.

I created a lesson all about variations here that you can follow:

It will show you how to model and code what you need. If you have any questions let me know :slight_smile:

1 Like

Thank you so much! Will deep dive in to the academy soon and learn more :smiley:

1 Like