CiviCRM is managing Nestable groups, it would be great to have something similar for Tags.
As opposed to the groups, that introduce new ACL, the hierarchical tags are only a graphical tool, allowing to group related tags instead of having to deal with a long list of tags.
For instance, your organisation can use Tags to qualify both the region and the topic your contacts are interested in.
Instead of having a list mixing the two "type of tags":
Addiction (topic)
Africa (region)
AIDS (topic)
America (region)
Each Tag could be put below a "parent tag", to make them easier to find:
Region (parent tag)
- Africa (region)
- America (region)
Topic
- Addiction (topic)
- AIDS (topic)
The SQL stucture of CiviCRM already has a parent field on tags, that's "simply" a matter of changing the display.
However, Some parent tags (as in the previous example) shouldn't be selectable (saying someone is interested in a Topic or a Region isn't meaningful). I'd like to update the structure of the tag to introduce a new boolean "is_selectable" civicrm_tag.is_selectable (true by default).
The headers are is_selectable=false. It would mean that this "tag" can't be checked but is only used to organise the other tags.
The hierarchical tags is fully compatible with the existing code, and if a template that uses tags isn't updated, then all tags are going to be displayed as a flat list, as of today (ie. the parent id isn't taken into account).
Impact and stuff to change
DB Structure
Change the structure to introduce the new boolean. ideally before the 2.1 freeze (so it will be easier to dev on a 2.1 and commit only the code on a 2.2). Change, of course, the Tag DAO.
Tag select/Tag display structure
Group the tags based on the parent. We can still use only one sql query to select the tags group by parent id, and do the layout at the php level. We (TTTP) can do the dev for the 2.2
Limit the tags to a subpart of the tree on profile
Could be proven handy to be able on a profile to include only some tags (eg: only the region) instead of all.
