New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Internal Tags - Tags for Structure & Workflow #6165

Closed
ErisDS opened this Issue Dec 3, 2015 · 6 comments

Comments

Projects
None yet
4 participants
@ErisDS
Copy link
Member

ErisDS commented Dec 3, 2015

We've made pretty huge progress in terms of all the new tag features that were outlined in Tags 101, as well as massively overhauling all of the UIs related to tags.

One feature we've not looked at adding yet, is adding two levels of 'Visibility' so that we can have a concept of hidden tags. This feature has been referred to as 'private' tags, however I think it may be a good idea to not use the word 'private' as everywhere else private data explicitly refers to data that you must be authenticated to see (draft posts vs published) and this idea is not related to auth. I'm using 'hidden' as that's the name of the column in the database, but 'system' or 'internal' might work too.

Problem

At the moment, every tag you add to a post is the same. They all get listed on a post when it is published, and also get their own tag page / archive that lists out all of the posts. This makes perfect sense for tags which are meant to be a front-facing taxonomy, but limits the system so that tags cannot be used for workflow or structure. The idea of hidden tags is to make tags also useful for workflow and structure use cases:

Example 1: I want to tag a post with needs-review once I've finished writing it so my editor can pick it up.
At the moment you can do this, but you have to remember to remove the tag before publishing, and there is also not a good way to view all the posts marked with need-review in the admin panel.

Example 2: I want to implement link-posts which just link out to another site using a tag to mark my link posts so that my theme can handle them differently.
I can tag all these posts as link and handle this in my theme, however I also get link output in the tags list and all of these posts appear on /tag/link/ which isn't ideal.

Implementation

To solve this, tags being set to 'hashtag' will have two major impacts:

  1. There will not be a page at /tag/:slug/ for this tag
  2. This tag will not be output by the {{tags}} helper

The tag will still be returned by the API like any other tag, and available to theme, meaning it will still be possible to use {{#has tag="#hashtagname"}} to check if the tag is set on a post.

One minor potential confusion point will be that any theme which has opted to cycle through tags manually rather than use the {{tags}} helper will show hidden tags. These themes will need updating with a {{^unless hashtag}} condition inside their tag loops.

Creating hashtags

When adding tags in the editor, there's only a way to specify the name, rather than the type of tag. To combat this and make adding hidden tags quick & easy, it would be great if this could be controlled using a simple prefix. E.g. #needs-review. Any tag that has a # at the start of the name should automatically be marked as a hashtag. To resolve naming clashes in slugs between hidden and non-hidden tags with similar names, I think it would make sense to prefix the slugs for any hidden tags auto-created with a # with hash-``. So if I already havelinktag, and I create a#linktag, the slug for the first would belinkand for the secondhash-link`, etc.

Filtering in the admin UI

To really complete the power of this new feature, we need to be able to filter posts by tags in the admin UI. There are two aspects to this which I can think of:

  1. Showing posts which match by tag as well as title in the autocomplete search box
  2. Being able to get from a tag to a filtered content screen list of the posts that match that tag

I think there are a couple of potential investigations / spikes to do here around what can be done with the autocomplete search & content screen - can we list posts by tag in the autocomplete results? Can we make it so that pressing 'enter' on a term rather than clicking an item in the dropdown results in a filtered content screen list? How does it feel to have this result in a filter rather than a direct go-to-resource action as it does now?

Tasks

Prep:

  • Add labs flag for internal tags
  • Rework the server-side labs utility to be synchronous (so that {{tags}} doesn't become async)
  • Bonus: get config override working for client-side labs again
  • Update DB to have visibility property

When the labs flag is checked:

  • Add new checkbox to tag management screen to mark/unmark a tag as hashtag
  • Filter the result from {{tags}} to not include hashtags
  • Return a 404 from /tags/:slug/ for hashtags
  • Create tags starting with # as a hashtag in the tag input component
  • Display hashtags in the content list

Other:

  • Spike on the autocomplete & content list filter to see what works easily and if there are any dependencies or other requirements here.

Cleanup:

  • Remove labs flag
  • Add proper tests for 404 tag, and tags.read() with hash parameter

@ErisDS ErisDS added the epic label Dec 3, 2015

ErisDS added a commit to ErisDS/Ghost that referenced this issue Dec 3, 2015

Hidden tags labs flag
refs TryGhost#6165

- setup a config/labs flag ready for the hidden tags feature

@ErisDS ErisDS referenced this issue Dec 3, 2015

Closed

[Hold] Hashtags #6166

@kevinansfield

This comment has been minimized.

Copy link
Contributor

kevinansfield commented Dec 3, 2015

Do we also want to show the "system" labels in the posts list as a quick identifier? Using github's issue list as an example it's easy to see at a glance which posts have which status/tag:

screen shot 2015-12-03 at 11 50 50

@ErisDS

This comment has been minimized.

Copy link
Member

ErisDS commented Dec 3, 2015

I really like that idea 👍

@ErisDS ErisDS changed the title Feature: Hidden Tags - Tags for Structure & Workflow Feature: Internal Tags - Tags for Structure & Workflow Dec 3, 2015

kevinansfield added a commit to ErisDS/Ghost that referenced this issue Dec 3, 2015

Add "hidden" field to tag settings form
refs TryGhost#6165
- adds a checkbox field to the tag settings form to mark a tag as hidden
- fixes error in tag controller's `saveTagProperty` method when a non-string value is saved

kevinansfield added a commit to ErisDS/Ghost that referenced this issue Dec 3, 2015

Add "hidden" field to tag settings form
refs TryGhost#6165
- adds a checkbox field to the tag settings form to mark a tag as hidden
- fixes error in tag controller's `saveTagProperty` method when a non-string value is saved

kevinansfield added a commit to ErisDS/Ghost that referenced this issue Dec 3, 2015

Add "hidden" field to tag settings form
refs TryGhost#6165
- adds a checkbox field to the tag settings form to mark a tag as hidden
- fixes error in tag controller's `saveTagProperty` method when a non-string value is saved

ErisDS added a commit to ErisDS/Ghost that referenced this issue Dec 3, 2015

Change server-side labs utility to be synchronous
refs TryGhost#6165

- Use the settings cache to populate config.labs whenever settings change
- Use the labs util just to check if a flag isSet synchronously

kevinansfield added a commit to ErisDS/Ghost that referenced this issue Dec 4, 2015

Add "hidden" field to tag settings form
refs TryGhost#6165
- adds a checkbox field to the tag settings form to mark a tag as hidden
- fixes error in tag controller's `saveTagProperty` method when a non-string value is saved

kevinansfield added a commit to ErisDS/Ghost that referenced this issue Dec 4, 2015

Add "hidden" field to tag settings form
refs TryGhost#6165
- adds a checkbox field to the tag settings form to mark a tag as hidden
- fixes error in tag controller's `saveTagProperty` method when a non-string value is saved

kevinansfield added a commit to ErisDS/Ghost that referenced this issue Dec 4, 2015

Add "hidden" field to tag settings form
refs TryGhost#6165
- adds a checkbox field to the tag settings form to mark a tag as hidden
- fixes error in tag controller's `saveTagProperty` method when a non-string value is saved

ErisDS added a commit to ErisDS/Ghost that referenced this issue Dec 8, 2015

Hidden tags labs flag
refs TryGhost#6165

- setup a config/labs flag ready for the hidden tags feature

kevinansfield added a commit to ErisDS/Ghost that referenced this issue Dec 8, 2015

Add "hidden" field to tag settings form
refs TryGhost#6165
- adds a checkbox field to the tag settings form to mark a tag as hidden
- fixes error in tag controller's `saveTagProperty` method when a non-string value is saved

ErisDS added a commit to ErisDS/Ghost that referenced this issue Dec 8, 2015

Filter internal tags from {{tags}} helper
refs TryGhost#6165

- when the labs flag is checked:
- tags marked hidden (internal) should not be output by the `{{tags}}` helper

ErisDS added a commit to ErisDS/Ghost that referenced this issue Dec 8, 2015

Don't show tag pages for hidden/internal tags
refs TryGhost#6165

- Much like status for users/posts, tag.read requests need to take a 'hidden' argument
- The API returning a 404 for no match, results in the 404 cascading through
- Channel Config is updated so that the new config is only used if the labs flag is set

kevinansfield added a commit to kevinansfield/Ghost that referenced this issue Dec 8, 2015

Use # as hidden-tag denominator in editor tag input
refs TryGhost#6165
- adds `autocompleteName` CP to `tag` model that adds a preceding `#` to the name for use in autocomplete input
- updates `addTag` editor action to strip leading # from tag names and use that to mark new tags as hidden

If an attempt to add a hidden tag with the same name as an existing tag (eg, `#test` when an existing `test` tag exists) then the existing tag will be added to the post instead of a new tag being created.

kevinansfield added a commit to kevinansfield/Ghost that referenced this issue Dec 8, 2015

Display hidden/internal labels on posts in content list
refs TryGhost#6165
- adds `hiddenTags` CP to `post` model
- uses `.label` class to display list of hidden/internal tags for each post in content list

@kevinansfield kevinansfield referenced this issue Dec 8, 2015

Closed

Filter content list by tag #6190

0 of 8 tasks complete

@ErisDS ErisDS referenced this issue Dec 8, 2015

Closed

Sprint Epic 8th Dec - 12th January #6191

7 of 9 tasks complete

@ErisDS ErisDS added the feature label Dec 8, 2015

ErisDS added a commit to ErisDS/Ghost that referenced this issue Dec 8, 2015

Tag creation via post honours more fields
refs TryGhost#6165

- tag creation via posts was only honouring the tag.name. This made sense as it was the only field we were ever sending
- tag creation via posts now accepts name, slug, description, image, hidden, parent_id,  meta_title and meta_description, all other fields are calculated

kevinansfield added a commit to kevinansfield/Ghost that referenced this issue Dec 9, 2015

Use # as hidden-tag denominator in editor tag input
refs TryGhost#6165
- rename tag.hidden -> tag.hashtag
- tags input checks for tag name starting in # and marks it as a hashtag when creating

kevinansfield added a commit to kevinansfield/Ghost that referenced this issue Dec 9, 2015

Display hashtags on posts in content list
refs TryGhost#6165
- adds `hiddenTags` CP to `post` model
- uses `.label` class to display list of hidden/internal tags for each post in content list

kevinansfield added a commit to kevinansfield/Ghost that referenced this issue Dec 9, 2015

Use # as hidden-tag denominator in editor tag input
refs TryGhost#6165
- rename tag.hidden -> tag.hashtag
- tags input checks for tag name starting in # and marks it as a hashtag when creating

kevinansfield added a commit to kevinansfield/Ghost that referenced this issue Dec 9, 2015

Display hashtags on posts in content list
refs TryGhost#6165
- adds `hiddenTags` CP to `post` model
- uses `.label` class to display list of hidden/internal tags for each post in content list

ErisDS added a commit to ErisDS/Ghost that referenced this issue Dec 9, 2015

Hashtags labs flag
refs TryGhost#6165

- setup a config/labs flag ready for the hashtags feature

ErisDS added a commit to ErisDS/Ghost that referenced this issue Jun 10, 2016

ErisDS added a commit to ErisDS/Ghost that referenced this issue Jun 10, 2016

internal tags feature
refs TryGhost#6165
- change behavior to use 'visibility' property
- finish out client & server-side behavior
- add tests

acburdine added a commit to acburdine/Ghost that referenced this issue Jun 10, 2016

acburdine added a commit to acburdine/Ghost that referenced this issue Jun 10, 2016

internal tags feature
refs TryGhost#6165
- change behavior to use 'visibility' property
- finish out client & server-side behavior
- add tests

acburdine added a commit to acburdine/Ghost-Admin that referenced this issue Jun 10, 2016

internal tags feature
refs TryGhost/Ghost#6165
- change behavior to use 'visibility' property
- add tests

acburdine added a commit to acburdine/Ghost-Admin that referenced this issue Jun 10, 2016

internal tags feature [ci skip]
refs TryGhost/Ghost#6165
- change behavior to use 'visibility' property
- add tests

acburdine added a commit to acburdine/Ghost-Admin that referenced this issue Jun 10, 2016

internal tags feature
refs TryGhost/Ghost#6165
- change behavior to use 'visibility' property
- add tests

ErisDS added a commit to ErisDS/Ghost that referenced this issue Jun 11, 2016

Update tags & foreach to respect `visibility`
refs TryGhost#6165

- adds lodash.pickby@4.4.0
- new helper util for understanding a visibility attribute
- generalises visibility handling for `{{tags}}` helper
- adds visibility handling to `{{foreach}}` helper
- adds tests which check behaviour + labs flag

acburdine added a commit to acburdine/Ghost that referenced this issue Jun 11, 2016

internal tags feature
refs TryGhost#6165
- change behavior to use 'visibility' property
- finish out client & server-side behavior
- add tests

ErisDS added a commit to ErisDS/Ghost that referenced this issue Jun 11, 2016

Update tags & foreach to respect `visibility`
refs TryGhost#6165

- adds lodash.pickby@4.4.0
- new helper util for understanding a visibility attribute
- generalises visibility handling for `{{tags}}` helper
- adds visibility handling to `{{foreach}}` helper
- adds tests which check behaviour + labs flag

acburdine added a commit to acburdine/Ghost-Admin that referenced this issue Jun 13, 2016

internal tags feature
refs TryGhost/Ghost#6165
- change behavior to use 'visibility' property
- add tests

kevinansfield added a commit to kevinansfield/Ghost that referenced this issue Jun 15, 2016

Update tags & foreach to respect `visibility`
refs TryGhost#6165

- adds lodash.pickby@4.4.0
- new helper util for understanding a visibility attribute
- generalises visibility handling for `{{tags}}` helper
- adds visibility handling to `{{foreach}}` helper
- adds tests which check behaviour + labs flag
@kenofthenorth

This comment has been minimized.

Copy link

kenofthenorth commented Sep 5, 2016

Hidden tags should also be removed from meta tags like 'twitter:data2'
Thanks!

@WaqasIbrahim

This comment has been minimized.

Copy link

WaqasIbrahim commented Sep 26, 2016

Hi, I am using internal tags in my theme development but i am having a small issue. I wanted to use internal tags for post types and use them as class names. Currently as far as i know internal tags are fetched along with the hashtag. I am using a workaround with javascript to remove the hashtags so they can be used as class names. Is there a way to fetch them without the hashtag? Thanks

@ErisDS

This comment has been minimized.

Copy link
Member

ErisDS commented Sep 28, 2016

@WaqasIbrahim Tag names have never been suitable for use as class names, as they can include any character except , that includes spaces, tabs, etc. Instead, you should use the slug version of the name for a classname. The sluggified name is all lowercase and hyphenated and therefore suitable for class names.

ErisDS added a commit to ErisDS/Ghost that referenced this issue Oct 7, 2016

Move internal tags out of labs
closes TryGhost#6165

- internal tags has been in labs for a couple of months, we've fixed some bugs & are ready to ship
- this marks TryGhost#6165 as closed because I think the remaining UI tasks will be handled as part of a larger piece of work

ErisDS added a commit to ErisDS/Ghost that referenced this issue Oct 7, 2016

Move internal tags out of labs
closes TryGhost#6165

- internal tags has been in labs for a couple of months, we've fixed some bugs & are ready to ship
- removes all code that tests for the labs flag
- also refactors the various usage of the visibility filter into a single util
- all the tests still pass!!!
- this marks TryGhost#6165 as closed because I think the remaining UI tasks will be handled as part of a larger piece of work

kevinansfield added a commit to TryGhost/Ghost-Admin that referenced this issue Oct 10, 2016

Move internal tags out of labs (#315)
refs TryGhost/Ghost#6165

- it's time to move internal Tags out of labs!
- remove the checkbox & all lab/feature flag code for internalTags

kevinansfield added a commit that referenced this issue Oct 10, 2016

Move internal tags out of labs (#7519)
closes #6165

- internal tags has been in labs for a couple of months, we've fixed some bugs & are ready to ship
- removes all code that tests for the labs flag
- also refactors the various usage of the visibility filter into a single util
- all the tests still pass!!!
- this marks #6165 as closed because I think the remaining UI tasks will be handled as part of a larger piece of work

mixonic added a commit to mixonic/Ghost that referenced this issue Oct 28, 2016

Move internal tags out of labs (TryGhost#7519)
closes TryGhost#6165

- internal tags has been in labs for a couple of months, we've fixed some bugs & are ready to ship
- removes all code that tests for the labs flag
- also refactors the various usage of the visibility filter into a single util
- all the tests still pass!!!
- this marks TryGhost#6165 as closed because I think the remaining UI tasks will be handled as part of a larger piece of work

madfrog2047 added a commit to madfrog2047/Ghost that referenced this issue Nov 20, 2016

Add visibility column to posts, tags and users
refs TryGhost#6301, TryGhost#6165

- visibility is added as a new column on posts, tags and users.
- has a relevant default value for each table

madfrog2047 added a commit to madfrog2047/Ghost that referenced this issue Nov 20, 2016

madfrog2047 added a commit to madfrog2047/Ghost that referenced this issue Nov 20, 2016

internal tags feature
refs TryGhost#6165
- change behavior to use 'visibility' property
- finish out client & server-side behavior
- add tests

madfrog2047 added a commit to madfrog2047/Ghost that referenced this issue Nov 20, 2016

Update tags & foreach to respect `visibility`
refs TryGhost#6165

- adds lodash.pickby@4.4.0
- new helper util for understanding a visibility attribute
- generalises visibility handling for `{{tags}}` helper
- adds visibility handling to `{{foreach}}` helper
- adds tests which check behaviour + labs flag

madfrog2047 added a commit to madfrog2047/Ghost that referenced this issue Nov 20, 2016

Move internal tags out of labs (TryGhost#7519)
closes TryGhost#6165

- internal tags has been in labs for a couple of months, we've fixed some bugs & are ready to ship
- removes all code that tests for the labs flag
- also refactors the various usage of the visibility filter into a single util
- all the tests still pass!!!
- this marks TryGhost#6165 as closed because I think the remaining UI tasks will be handled as part of a larger piece of work
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment