How to "is_entry" if everything is a collection?

Now that everything is a collection, how do I use the "is_entry" variable?

My Statamic v2 sites have pages and collection entries and I've used lines of code like this:

<body>
  <main class="main{{ if is_entry && collection == 'services' }} entry-services{{ elseif is_entry && collection == 'team' }} entry-team{{ /if }}</main>
</body>



Pretty verbose, I know. But it did what I needed it to do.

However... I've now opted to use the "Expects root" option for collections (thanks again for clarifying, Erin) and I'm considering a collection's root as a "page". So — all entries in the "services" collections need to be included in the whole {{ if is_entry && collection == 'services' }} variable, except the collection root entry.

Hoping anyone can help me yet again ;-)

>>>>>>> Unanswered <<<<<<<
3 Replies
2 Followers