wvuweb / hammer

A tool for CleanSlate theme development
https://cleanslate.wvu.edu
4 stars 2 forks source link

Page filters incorrectly uses the `tags` keyword when it should use the `labels` keyword #98

Open adamjohnson opened 3 years ago

adamjohnson commented 3 years ago

Steps to reproduce the issue

  1. Start hammer
  2. Clone the provost-oedc repository.
  3. Go to the profiles_index.html template.

Results

If you look in mock_data.yml, the pages key has several pages with tags.

When looking at the output, the pages are not filtered appropriately.

Expected results

Hammer should output only the pages with the appropriate tag/label.

What's happening here?

This is confusing because blogs/articles can be filtered using the tags keyword; whereas, pages can only be filtered using the labels keyword.

Example code for blogs filtering via tags.

Example code for pages filtering via labels.

Potential solution

Blog articles can keep using the tags keyword and pages should change to use the labels keyword for filtering. In mock_data, the keyword tags would change to labels. This is how CleanSlate works in production.

We would also have to simultaneously update the docs here on Github.

Link to page filters in CleanSlate repo:

cleanslate/blob/dev/app/lib/slate/radius/tags/page.rb#L281 (Github)