Way to exclude entries from particular tag?

Is it possible for my front page (I’m using Ruby) to exclude posts that are tagged with a particular tag? I list items for sale on my site (Volver.ca) and when they sell, I also tag them Sold.

Some customers would rather only see available titles and not see what they’ve missed. Is it possible to create a “All Titles / Just Available Titles” toggle for such a thing, or, if that’s too complicated, just have my front page not display things that are tagged Sold?

I know I could delete the sold items, but some customers do like to look at them and they’re very handy for directing people to who want to sell me things so they can get an idea of what moves. It’s also useful for Google searches as I get new customers who searched for a particular title, even though I no longer have it.

Thanks.

Yep. You’re going to want to write a routes.yaml file. :)

You could set those up as either channels or collections. Take a stab at it, and then post what you have so far if you get stuck!

Thanks, Cathy_Sarisky.

I read through the linked page and 99% of that is above my head but from what I can discern, I’m best to look at it as a channel as one of the example uses is for filtering out posts that are tagged with a particular tag. The example is NOT Steve.

However, as far as I can tell, none of the actual code examples tell you how to do the NOT part. All of them are inclusive examples like News+Steve.

It seems like it’s saying something is possible to do (exclude a certain tag from displaying) but does not have an example of how to do it. Am I missing something or is the documentation missing something?

I’d maybe do this:

routes:
  /all/:
    controller: channel

collections:
  /:
    permalink: /{slug}/
    filter: tags:-[sold]
    template: home *** or index if Ruby doesn't have a home.
  /sold/:
    permalink: /{slug}/
    filter: tags:[sold]
    template:  ***see above***

taxonomies:
  tag: /tag/{slug}/
  author: /author/{slug}/
  

I’m making /all/ a channel, because a post can only belong to one collection. (There are several other configurations of channels and routes possible here. This is just one.)

1 Like

Thank you, Cathy.I will try this out in the next few days.Down with flu the moment.